Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用WebMatrix。我将 abc.doc 文件上传到文件夹。创建一个超链接来下载文件。示例:<a href="~/uploads/StudyMaterial/abc.doc">。
<a href="~/uploads/StudyMaterial/abc.doc">
当我单击链接时,将下载名为 abc.doc 的文件。下载文件时如何将其重命名为 Hello.doc?
为了重命名文件,您可以在将标头添加到响应filename时设置属性:Content-Disposition
filename
Content-Disposition
Response.AppendHeader("Content-Disposition", "attachment; filename=\"Hello.doc\"");