Jump to content

Accepting Uploaded Files


prcollin

Recommended Posts

$_FILES['userfile']['type'] is how you get the type then do like if

 

if($_FILES['userfile']['type'] != image/pjpeg)

{

//Bad file type delete it or something and echo bad.

}

else

{

//lets say it was a good type.

}

 

 

         'text/html', 

         'text/plain', 

         'text/css', 

         'image/gif', 

         'image/x-png', 

         'image/jpeg', 

         'image/tiff', 

         'image/png', 

         'image/x-ms-bmp', 

         'audio/x-wav', 

         'application/x-pn-realaudio', 

         'video/mpeg', 

         'video/quicktime', 

         'video/x-msvideo', 

         'application/postscript', 

         'application/rtf', 

         'application/pdf', 

         'application/x-pdf', 

         'application/x-gtar', 

         'application/x-tar', 

         'application/zip', 

         'application/x-zip-compressed', 

         'application/mac-binhex40', 

         'application/x-stuffit', 

         'application/octet-stream', 

         'text/javascript', 

         'application/x-javascript', 

         'application/x-sh', 

         'application/x-csh', 

         'application/x-perl', 

         'application/x-tcl', 

         'application/vnd.ms-powerpoint', 

         'application/ms-powerpoint', 

         'application/vnd.ms-excel', 

         'application/msword', 

         'video/avi', 

         'java/*', 

         'application/java', 

         'image/x-icon', 

         'image/bmp', 

         'image/pjpeg', 

         'application/x-bittorrent' 

Theres a list of types from

http://www.redvodkajelly.com/code/php-file-upload-class/

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.