🚀 File Upload & Metadata Explorer

📤 Upload Your File

Drag & Drop a file here or click to select

0%

✅ Upload Complete & Metadata Extracted

Server Filename:

â„šī¸ Introduction

Welcome! This tool allows you to upload files and instantly see detailed metadata extracted from them. See file size, dates, permissions, media codecs, image EXIF data, and more.

✨ Features

âš™ī¸ How It Works

  1. Select/Drop File: Choose a file using the dialog or drag it onto the box.
  2. Upload (JS): Your browser sends the file asynchronously (AJAX) to the server, updating the progress bar.
  3. Receive & Save (PHP): The server validates the upload, checks for errors, sanitizes the filename, and saves the file to the uploads/ directory.
  4. Extract Metadata (PHP): PHP uses stat(), finfo, and conditionally calls the external ffprobe command and uses the internal exif_read_data function to gather details.
  5. Respond (PHP): Metadata is formatted as JSON and sent back to your browser.
  6. Display Results (JS): JavaScript receives the JSON, displays success/error messages, and populates the metadata table.

❓ FAQ

Which files give the most metadata?
Video/audio files (e.g., MP4, MKV, MP3, FLAC) show detailed media information if ffprobe is installed and accessible by the web server. JPEG/TIFF/WEBP/AVIF images show EXIF data if the PHP exif extension is enabled.
Is there a size limit?
Yes, primarily limited by your server's PHP configuration directives: upload_max_filesize and post_max_size in php.ini. The script attempts to report errors related to these limits.
What is ffprobe?
A command-line tool that's part of the FFmpeg project, used for analyzing multimedia streams. It must be installed separately on the server where this PHP script runs.
Why is some metadata missing or showing an error?
Possible reasons include: the file type doesn't inherently contain that type of metadata (e.g., a text file won't have EXIF data); the necessary tool (ffprobe) or PHP extension (fileinfo, exif, posix) isn't installed, enabled, or accessible to the web server process (www-data); the file itself is corrupted or malformed; or server permission issues prevent reading the file or executing commands.
Is this secure?
This is an educational example. **Using it in a production environment requires significant security hardening.** Risks include uploading malicious files. Essential steps: strictly validate allowed file types/extensions/MIME types, scan uploaded files for malware, ensure the uploads/ directory is NOT web-accessible if possible (or use .htaccess to deny direct access), implement user authentication/authorization, run the web server with minimal privileges, and keep server software updated. See the Disclaimer.

âš ī¸ Disclaimer

Use this script responsibly and at your own risk. It's provided as an educational example and lacks robust security features suitable for a production environment.