Page 1 of 1

Wrong mime-type?!

Posted: Tue Feb 16, 2010 2:56 pm
by Phix
I've got a CMS under development, and to have the guy upload pictures, I'm having him upload a ZIP which the server then unzips. It was working a few weeks ago, but now when I upload the zip file, the $_FILES type is coming back as a application/octet-stream, instead of the application/x-zip-compressed I wanted. What's going on? I've tried rezipping, nothing. Why is it going up as a octet and not the zip it actually is?!

Re: Wrong mime-type?!

Posted: Tue Feb 16, 2010 3:06 pm
by AbraCadaver
The browser sends the file type and it isn't reliable. You can try either mime_content_type() or finfo_file().

Re: Wrong mime-type?!

Posted: Tue Feb 16, 2010 6:28 pm
by Phix
Nice. Thank you. I must have been testing in another browser before.