2

Content-Disposition是否有“附件;文件名=...”的替代方法?

我正在发送一个流式传输的 exe 文件,并希望浏览器在我开始发送时打开“另存为”或“运行”。

我正在使用 C# HttpResponseHeader 并希望使用它的成员或 HttpWorkerRequest 成员。

谢谢,摩西

4

1 回答 1

0

Content-Disposition是让浏览器提示用户保存文件的正确方法。用于HttpResponse.AppendHeader()添加标头值,例如:

Response.AppendHeader("Content-Type", "...") 
Response.AppendHeader("Content-Disposition", "attachment; filename=...") 
于 2015-01-20T17:17:02.277 回答