我需要您的帮助为我的网站http://usb-online.fr。这是一个PHP文件托管网站和这里的的下载事物的一部分:PHP文件托管
header("Content-Type: $mime; name=\"$fichier\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: $taille");
header('Content-Description: Fichier hebergé par usb-online.fr');
header("Content-Disposition: attachment; filename=\"$fichier\"");
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
ob_clean();
flush();
log_download($file,$infos['auteur'],$taille);
bunzip2($path);
如果你试试这个网址: http://usb-online.fr/file-download-822MjYzMg.html 你会看到一个下载对话框打开,并且不显示图像,这就是我想要的。 但是用户在网站上做了<img src="http://usb-online.fr/file-download-822MjYzMg.html"/>
,他可以显示图像,我的服务器变得很忙。我不想让这个,我该怎么办? http://usb-online.fr/file-download-822MjYzMg.html
它们使用$ _SERVER ['HTTP_REFERER']。我认为这不可靠。 – timmalos
我不能这样做,因为链接可以进入论坛或类似的东西,他们应该能够下载文件。所以我不能说:如果有referer不显示文件。 – timmalos