簡體   English   中英

PHP Android 如何下載apk文件

[英]PHP Android how to dowload apk file

我的服務器上有 Android 應用程序,還有 php 代碼,例如:

header('Content-Type: application/vnd.android.package-archive');
header('Content-Disposition: attachment; filename="test.apk"');
readfile('test.apk');

我的帶有默認網絡瀏覽器的手機正在以在屏幕上讀取 apk 文件的方式下載此文件。 我期待某種對話,例如:將其另存為或/以及您想將其保存在哪里。 我做錯了什么? 有沒有辦法自動保存它,意思是沒有任何對話?

嘗試:

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');

您應該嘗試以下方法之一:

  1. 檢查服務器上的 MIME 類型配置。 APK 文件
  2. 將 apk 擴展添加到 apache

另外,檢查這個問題 但是服務器是.net,而不是php。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM