Hi,
I’m building a “downloads” page for a client and some of the downloads are .exe files which, by default, are not allowed file types.
I’ve tried adding .exe mime types to:
system/ee/EllisLab/ExpressionEngine/Config/mimes.php
…but still get a ‘File not allowed’ message when trying to upload an .exe file.
These are the mime types I’ve tried adding to the mimes.php whitelist:
application/x-msdownload application/octet-stream application/x-zip-compressed application/vnd.microsoft.portable-executable
…none of which appear to work for me. Any ideas where I’m going wrong?
Many thanks,
Andy
I’d check and see what it’s seeing those files as. FTP one up- then go to a template, turn php parsing on, and put this:
<?php
ee()->load->library('mime_type');
$path = '/Users/robinb/sites/exp5/exp-bad.pdf';
$out = ee()->mime_type->ofFile($path);
print_r($out);
?>
Change the $path so it’s the path to the exe file you ftp’d up. Just see what it prints out. I tested with a pdf and I got: application/pdf
I swear, they don’t make dealing with mime type easy! Glad that’s got you working.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.