【发布时间】:2015-04-05 12:27:11
【问题描述】:
服务器中名为“hashed.png”的文件。我可以要求像
“http://server_name/hashed.png”
但是当我上传到服务器时它的原始名称是'hello.png'(它的关系在db中)并且当我请求该url并下载它时,它命名为'hashed.png'。我想显示它'hello.png'
总结:我想做这样的事情
当我上传 'hello.png' 时,服务器将其保存在 'hashed.png' + 保存在 'hello.png'、'hashed.png' 的 db 关系中。在php中,我知道'hashed.png'的原名是'hello.png'。
当我请求“server.com/hashed.png”时,会显示图像,当我尝试保存时,它的名称会自动填充为“hello.png”
我发现命名为“Content-Disposition”,但是当用户通过图像的直接 url 请求时,我不知道如何运行 php 代码。
【问题讨论】:
标签: php image content-disposition