php - file upload not working for doc, excel file -
i using below code file upload not work in case of doc , excel file
switch(strtolower($imagetype)) { case 'image/png': case 'image/gif': case 'application/pdf': case 'image/jpeg': case 'video/avi': case 'video/mp4': case 'image/pjpeg': case 'application/msword': case 'application/vnd.ms-excel': break; default: die('unsupported file!'); //output error , exit }
this code work case of image when upload doc file. show me unsupported file
you missing additional mime types. mime types correct older .doc , .xls files, not newer ones.
for .xlsx files use:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
for .docx files use:
application/vnd.openxmlformats-officedocument.wordprocessingml.document
this might well:
Comments
Post a Comment