troubleshooting Question

Specifying Multiple Mime Type to Use within PHP Upload Class

Avatar of rito1
rito1 asked on
4 Comments3 Solutions483 ViewsLast Modified:
Hi All,

I am currently using the following upload class to handle file uploaded within my form:

One of the filetypes I want to support is .PPT. Now, this file type could have several mime types:

Please could anyone suggest how I could handle multiple mime types for this class.

My code for this area is as follows and I thought that if I just add an instance of the PPT file type for each mime type available that this would sort it but it doesn't seem to be the case.

Many thanks,

$upload->set("supported_extensions",array("pdf" => "application/pdf" ,"ppt" => "application/mspowerpoint" ,"ppt" => "application/ms-powerpoint" ,"ppt" => "application/mspowerpnt" ,"ppt" => "application/vnd-mspowerpoint" ,"ppt" => "application/" ,"ppt" => "application/powerpoint" ,"ppt" => "application/x-powerpoint" ,"ppt" => "application/x-mspowerpoint" ,"doc" => "application/msword" ,"doc" => "application/msword" ,"tif" => "image/tif" ,"tiff" => "image/tiff" ,"bmp" => "image/bmp" ,"dxf" => "application/dxf" ,"dwg" => "application/acad" ,"docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document" ,"pptx" => "application/vnd.openxmlformats-officedocument.presentationml.presentation" ,"pub" => "application/x-mspublisher" ,"gif" => "image/gif" ,"jpg" => "image/jpeg" ,"jpeg" => "image/pjpeg" ,"png" => "image/x-png")); // Allowed extensions and types for uploaded file.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 3 Answers and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros