CodeIgniter Forums
Can not upload .apk file - 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: Can not upload .apk file (/showthread.php?tid=45406)



Can not upload .apk file - El Forum - 09-20-2011

[eluser]fishboy[/eluser]
Hello,

I am working on application that upload some kind of file from PC to the server. I am using Codeigniter version 2.0.3. The kind of files are either images (gif, jppg, png) or Android application package file (.apk). With images file the code work fine but when I am trying to upload .apk it give me:

Quote:The filetype you are attempting to upload is not allowed.

You can find the code from the CI user guide here in this link:
Code:
http://ellislab.com/codeigniter/user-guide/libraries/file_uploading.html

I did this tow change:
(1) I set the .apk in the allowed types:

Code:
$config['allowed_types'] = 'gif|jpg|png|apk';


(2)And I added this line in the mime.php file in the application\config directory:

Code:
'apk' => 'application/vnd.android.package-archive'

What is missing or I have to do??


Can not upload .apk file - El Forum - 04-23-2012

[eluser]Unknown[/eluser]
Thanks LuckyFella73!

I using code:
Code:
echo mime_content_type('path/testfile.apk');

Result:
Code:
application/zip

And config/mine.php:
Code:
'apk' => array('application/zip'),

Finally, my apk upload file done!