CodeIgniter Forums
Firefox 5 - Upload allowed_types no longer working properly - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Firefox 5 - Upload allowed_types no longer working properly (/showthread.php?tid=42938)



Firefox 5 - Upload allowed_types no longer working properly - El Forum - 06-24-2011

[eluser]Philo01[/eluser]
Hi all,

I've just upgraded my Firefox to v5 and now the upload validation is no longer working properly.

Code:
$config['allowed_types'] = 'html|zip';

When trying to upload a ZIP file I get the following error:
"The filetype you are attempting to upload is not allowed."

This was working in Firefox 4. I also tried to use Safari and that works like it should.

How is this possible?

Kind regards,

Philo


Firefox 5 - Upload allowed_types no longer working properly - El Forum - 06-24-2011

[eluser]InsiteFX[/eluser]
Maybe you need to add a new user_agent for FireFox 5.


Firefox 5 - Upload allowed_types no longer working properly - El Forum - 06-24-2011

[eluser]danmontgomery[/eluser]
It's possible because the mime type that CI validates against is the one generated by the browser.

You can disable allowed_types, use $this->upload->data() to see what mime type CI is getting, and add it to config/mimes.php


Firefox 5 - Upload allowed_types no longer working properly - El Forum - 06-24-2011

[eluser]pmoroom[/eluser]
FF 5.0 sees the type as application/x-download whereas IE/FF 4.x see it as application/x-zip-compressed

I fixed it by modifying my mime types in config/mimes.php.

'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/x-download','application/download'),

There is more information here (although older) https://bugzilla.mozilla.org/show_bug.cgi?id=527992


Firefox 5 - Upload allowed_types no longer working properly - El Forum - 06-24-2011

[eluser]osci[/eluser]
[quote author="pmoroom" date="1308975139"]FF 5.0 sees the type as application/x-download whereas IE/FF 4.x see it as application/x-zip-compressed

I fixed it by modifying my mime types in config/mimes.php.

'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/x-download','application/download'),

There is more information here (although older) https://bugzilla.mozilla.org/show_bug.cgi?id=527992[/quote]

I was about to check. thnx for the info.