Welcome Guest, Not a member yet? Register   Sign In
Upload problems for 7z on CI2.1.0
#1

[eluser]davlyn[/eluser]
I work on a site where a user is allowed to upload zip, rar or 7z.

In config/mimes.php I added

Code:
'7z' => 'application/x-7z-compressed',
                                
'rar'   =>  array('application/x-rar-compressed', 'application/rar', 'application/octet-stream')

While rar works 7z doesn't.

Any suggestions to what I should change the mime?

EDIT:

Putting the 'allowed_types' = '*' helps but then i have a problem of accepting all the files.

EDIT 2:

I added
Code:
'7z'    =>     array('application/x-7z-compressed', 'application/7z', 'application/octet-stream'),

Instead of the previous one and tried it on in Opera and Chrome, it works, while in Firefox it still doesn't work. Even IE works...


SOLUTION:

Firefox handles MIMES in its own way so in mimeTypes.rdf located in the firefox profiles you can find what mime it uses for some reason the extension for 7z case it is application/force-download

SO just add this to mime
Code:
'7z'    =>     array('application/x-7z-compressed', 'application/7z', 'application/force-download', 'application/octet-stream'),

Although I am not sure about the application/octet-stream but I think it can't hurt.
#2

[eluser]davlyn[/eluser]
Found the solution all in the first post.




Theme © iAndrew 2016 - Forum software by © MyBB