Page 1 of 1

File Upload Problem!

Posted: Sun Jun 27, 2004 11:54 am
by Joe
I have managed to make a file upload script which works great for uploading .zip files but the only problem is that I am wishing for Excel and .doc files to be uploaded also. My protection against other uploads gos like:

if ($_FILES['imagefile']['type'] != "application/x-zip-compressed")

I know that application/x-zip-compressed is for zipped files but what exactly would I use for excel and .doc files?


Regards


Joe 8)

Posted: Sun Jun 27, 2004 12:19 pm
by kettle_drum
Upload the file and echo $_FILES['imagefile']['type']

Heres a list of popular mimi types:

'text/html',
'text/plain',
'text/css',
'image/gif',
'image/x-png',
'image/jpeg',
'image/tiff',
'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',
'audio/mpeg'

Posted: Sun Jun 27, 2004 1:07 pm
by Joe
Thanks alot kettle_drum. Much appreciated ;)