Disposition in HTTP Header (c#)

Is there an alternative for Content-Disposition with "attachment; filename=..."?

I'm sending a streamed on the fly exe file and wish the browser to open the "save as" or "run" when I begin sending.

I'm using the C# HttpResponseHeader and wish to use its members or the HttpWorkerRequest members.

Thanks, Moshe


Content-Disposition is the correct way to get the browser to prompt the user to save the file. Use HttpResponse.AppendHeader() to add the header value, eg:

Response.AppendHeader("Content-Type", "...") 
Response.AppendHeader("Content-Disposition", "attachment; filename=...") 
链接地址: http://www.djcxy.com/p/46832.html

上一篇: ASP.NET MVC:C#下载文件并另存为对话框

下一篇: 在HTTP标头中处理(c#)