Welcome Guest, Not a member yet? Register   Sign In
upload RAR & ZIP in code igniter

I can't upload Zip & rar files in CI, any ones helps me!!! SR about my English skill!

Have you added zip and rar to the allowed file types?
$config['allowed_types'] = 'zip|rar';

I have added zip and rar to the allowed file types.
$config['allowed_types'] = 'rar|zip';
I've opened application/config/mimes.php
and added:
'rar'=> 'application/x-rar-compressed'
'rar'   =>  array('application/x-rar','application/x-rar-compressed')
but it's still incorrect. I can't upload RAR and ZIP files!

Are you able to upload other ASCII and binary file types? Cause it could be a generic upload problem (eg folder permission etc)

about folder permission: Right click on uploads folder and I've shared it on the network, allow users to change it.

I can upload file types: png, gif, txt... but I can't upload RAR and ZIP files.

I've added the following code into mines file:
'rar'   =>  array('application/rar','application/x-rar','application/x-rar-compressed')

now, I can upload RAR files,

the following code is available in mines files by CI:
'zip'    =>  array('application/zip','application/x-zip', 'application/x-zip-compressed'),
but I can't upload ZIP.

Anybody there help me!!!!

i have the same problem
any other extension is uploaded successfully but zip and rar always give error

any ideas ?

There is a bug on CI's Upload Class, there are a few threads about it and a workaround.

thank you phused for your reply
is there a temporary fix for this ?
i can't wait until the next CI release ...

I had this same problem and found a very easy solution.

My post here

Theme © iAndrew 2016 - Forum software by © MyBB