Mar 15, 2012

Android: Handling of Content-Disposition header on the android browser.

As part web development, something we need to create one script file to handle all download request from your server but, suddenly I try to work on android browser and get an issue on download name.

Scripname download.php
Download name: download.apk which not correct

To fix the issue:

header("Content-Disposition: attachment; filename=\"fast-and-the-furios.apk\"");
header("Content-Type: application/vnd.android.package-archive");






NOTE:
* Besure to put SPACE between attachment; and filename
* Also be sure to quote the filename with double-quote

Content-Disposition: attachment; filename="fast-and-the-furios.apk"



If you want to upload on android try to read this one multipart form upload on android. PS. I did now test his code yet, check in you own either. :)


Happy reading. :)

No comments: