Wrong mime-type?!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Phix
Forum Newbie
Posts: 21
Joined: Tue Jan 12, 2010 11:50 pm

Wrong mime-type?!

Post 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?!
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Wrong mime-type?!

Post by AbraCadaver »

The browser sends the file type and it isn't reliable. You can try either mime_content_type() or finfo_file().
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Phix
Forum Newbie
Posts: 21
Joined: Tue Jan 12, 2010 11:50 pm

Re: Wrong mime-type?!

Post by Phix »

Nice. Thank you. I must have been testing in another browser before.
Post Reply