0

PHPスクリプトを使用してダウンロードリンクを「http://mydomain.com/get.php?download/」に変更していますが、これをさらに変更して「/get.php?download/」またはそれ以上のもののみを表示するようにしていますボタンがリンクを保持している私のWebページの「?php」のような特定。

これが私のコードです:

<?php

$path = 'folder/blank.file/';
$mm_type="application/octet-stream";
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: " . $mm_type);
header("Content-Length: " .(string)(filesize($path)) );
header('Content-Disposition: attachment; filename="'.basename($path).'"');
header("Content-Transfer-Encoding: binary\n");

readfile($path); //output

exit();

?>

これはどのように可能ですか?ご協力いただきありがとうございます!

編集: lighttpd と invision 電源ボードを使用しています。

4

1 に答える 1