Welcome Guest, Not a member yet? Register   Sign In
Upload library and MIME types - order of items the culprit?
#1

[eluser]tinawina[/eluser]
Hi everyone -

I have used the file upload library successfully in the past. I have upgraded to 1.6.1 and have set up a little script to handle a file upload. Tested it out by trying to upload a zip archive -- didn't work.

This works in my other older scripts just fine so started digging around in the forum for answers and doing some testing. Here's what I came up with. I want to verify with you CI experts if this could be the problem.

In the application/config/mime.php file, the ZIP line looks like this out of the box:

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

I switched this so that the more typical 'application/zip' comes first:

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

When I tried again to upload a zip file making just this change, it worked fine. Weirdly, I wasn't able to upload PDFs either before this switch. But now PDF uploads work -- without any change to the pdf array (?). (I did start out with my $config['allowed_types'] set up to accept zip and pdf and host of other file types).

Just wondering why it would make a difference where an item is located within an array? Or am I running into something else that it might be good to know about now rather than after deployment.... Thanks for any/all help!
#2

[eluser]Seppo[/eluser]
The order in the array should not change anything... are you sure you haven't modified something else? Are you using the same browser - and uploading the same file?




Theme © iAndrew 2016 - Forum software by © MyBB