You’re absolutely correct. The MIME type is provided by the client and you cannot guarantee it is correct. For that matter, so is the file extension. If you need to be completely sure, you need to look at the file contents.
More Related Contents:
- PHP Upload fails for Video but not Image [closed]
- PHP create file with specific name [closed]
- How to force file download with PHP
- How to write into a file in PHP?
- Upload a file using PHP
- Need to write at beginning of file with PHP
- Reading and Writing Configuration Files
- Read a plain text file with php
- including php file from another server with php
- How to check if a file exists from a url
- Move_uploaded_file() function is not working
- PHP: Check if a file is loaded directly instead of including?
- php, file download
- Read a file backwards line by line using fseek
- How to delete a folder with contents using PHP [duplicate]
- uploading a file in chunks using html5
- PHP: Read Specific Line From File
- File creation time [closed]
- POST a file string using cURL in PHP?
- PHP move_uploaded_file() error?
- How to save memory when reading a file in Php?
- List and download clicked file from FTP
- Max file number can php upload at same time
- Difference between file, file_get_contents, and fopen in PHP
- A PHP script to let users download a file from my website without revealing the actual file link in my website?
- php script to delete files older than 24 hrs, deletes all files
- How to execute and get content of a .php file in a variable?
- Is this the most efficient way to get and remove first line in file?
- How download big file using PHP (low memory usage)
- Sort directory files by creation datetime in Windows filesystem