Welcome Guest, Not a member yet? Register   Sign In
Can not upload .apk file
#1

[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??
#2

[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!




Theme © iAndrew 2016 - Forum software by © MyBB