【发布时间】:2017-09-25 04:28:08
【问题描述】:
我想弄清楚如何使 myimage.jpg 成为超链接的尾端的一部分?
到目前为止,我已经下载了图片,但不确定如何使超链接看起来像:
http://192.168.0.11/myimage.jpg
到目前为止我的代码:
<?php
$file = "./my_image.jpg";
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.basename($file).'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
readfile($file);
exit;
}
?>
【问题讨论】: