...

validation of video

Pompiuses
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.

closer
08-03-2002, 05:51 PM
Take a gander at this:

http://www.php.net/manual/en/features.file-upload.php


$_FILES['userfile']['type']

The mime type of the file, if the browser provided this information. An example would be "image/gif".

dillieo
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

if (is_uploaded_file($HTTP_POST_FILES['adobe_upload']['tmp_name']))
{
$type = $HTTP_POST_FILES['adobe_upload']['type'];

if ($type == "application/pdf")
{
copy($HTTP_POST_FILES['adobe_upload']['tmp_name'], "DESTINATION");
}
else
{
die("Invalid file specified");
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum