1
我想弄清楚如何让myimage.jpg超链接的线索终点的一部分?如何添加图像名称与扩展到超链接尾端php
到目前为止,我已经得到了图片下载,但不知道如何让超级链接的样子:
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;
}
?>
谢谢。虽然我不想传递给HTML。我想在Android中使用Glide来使用图像。目前它获取图像并显示它。 –
所以你的问题解决了? – Sand
是的,一旦我删除标题,因为它正在下载,而不是显示它。 –