07-31-2002, 08:39 AM
I'm making a site where users can upload video files of various types such as avi,mpg etc. I wonder if there are any methods in PHP that checks the mime type of these filetypes. That is really checks that the file is a video file and not just a renamed exe file or something.
08-03-2002, 05:51 PM
Take a gander at this:
The mime type of the file, if the browser provided this information. An example would be "image/gif".
08-07-2002, 12:19 AM
Here's some code I used recently to verify that an Acrobat file had been uploaded...
Note: 'adobe_upload' is the name of the form item
$type = $HTTP_POST_FILES['adobe_upload']['type'];
if ($type == "application/pdf")
die("Invalid file specified");