Yet another .zip file uploading issue - 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: Yet another .zip file uploading issue (/showthread.php?tid=53497) |
Yet another .zip file uploading issue - El Forum - 07-26-2012 [eluser]thesleepydog[/eluser] I searched the forums and tried a few fixes but still can't get my upload function to accept a zip file. Error: Filetype not allowed. Other files listed in the config work fine. Here is my code. Thanks in advance for your time! Controller Code: public function upload_files() File Code: Array ( [userfile] => Array ( [name] => exx_ptr_logo_pkg.zip [type] => application/zip [tmp_name] => /var/tmp/phpys3tpQ [error] => 0 [size] => 196512 ) ) Mimes.php Code: 'zip' => array('application/zip', 'application/x-zip', 'application/x-zip-compressed', 'application/octet-stream', 'application/x-compress', 'application/x-compressed', 'multipart/x-zip'), Yet another .zip file uploading issue - El Forum - 07-26-2012 [eluser]john_j[/eluser] did you add this file type in your configuration file, $config['allowed_types'] ?? Yet another .zip file uploading issue - El Forum - 07-26-2012 [eluser]thesleepydog[/eluser] Yeah. See line 18ish towards the top of the posted controller code. Yet another .zip file uploading issue - El Forum - 08-02-2012 [eluser]thesleepydog[/eluser] Just an update: I was unable to get the file uploading class to let me specify individual file types separated by a pipe. It would upload a jpg but not any of the other file types. I tried just using a single file type as well. For example $config['allowed_types'] = 'png';. But no luck. It wouldn't let me upload the file. This is strange as I've been able to make this work before. Solution: I just allowed all file types with '*' and it works fine. I realize this is not ideal for a public facing page but since the upload page is for administrators who are logged in and that admin is me and a few other people I think it'll be ok. If anyone can point me in the right direction as to what I'm doing wrong I'd appreciate it. And yes, I have read the manual. Thanks. |