Reputation: 313
I have Android app on my server and also have php code like:
header('Content-Type: application/vnd.android.package-archive');
header('Content-Disposition: attachment; filename="test.apk"');
readfile('test.apk');
My mobile with default web browser is downloading this file in the way of reading apk file on the screen. I expected some kind of dialogue like: save it as or/and where do you want to save it instead. What I am doing wrong? Is there any way to save it automatically, meaning without any dialogue?
Upvotes: 0
Views: 7332
Reputation: 10471
you should try one of these:
also, check this question. However the server is .net, not php.
Upvotes: 0
Reputation: 14245
Try:
header("Cache-Control: public");
header("Content-Description: File Transfer");
header('Content-Type: application/vnd.android.package-archive');
header("Content-Transfer-Encoding: binary");
header('Content-Disposition: attachment; filename="test.apk"');
readfile('C4A.apk');
Upvotes: 1