1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PHPで、Android .apkをダウンロードする。

Posted at

■用途

・phpファイルを置いて、AndroidアプリからURLを叩いてapkファイルをダウンロードする。

●フォルダ構成

スクリーンショット (689).png
・ダウンロードするapkファイル
・今回 *** .phpファイル ***

■ソースコード

apk28.php

<?php
header('Content-Disposition: attachment; filename="app-debug.apk"'); // Android APK 記述
header('Content-Type: application/vnd.android.package-archive'); // Android APK 記述
header('Content-Transfer-Encoding: binary'); // エンコードタイプ
header('Content-Length: '.filesize("app-debug.apk")); // ダウンロードファイルサイズ
readfile("app-debug.apk"); // ダウロードファイル名
exit();


?>


<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>アンドロイド 10 対応版(2020-11-19 アップ版)</title>
</head>
<body>
    
</body>
</html>

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?