如何编写HttpWebRequest响应到浏览器
我正在努力实现这一点:
用户购买文件,点击链接,我这样做:
var filename =“SomeHighlySecureFile.mp3”; HttpWebRequest请求=(HttpWebRequest)WebRequest.Create(“http://myfiles.com/download.aspx?file=”+文件名); HttpWebResponse响应=(HttpWebResponse)request.GetResponse(); Stream responseStream = response.GetResponseStream();
context.Response.Buffer = true; context.Response.Clear(); context.Response.AddHeader(“content-disposition”,“attachment; filename =”+ fileinfo.Name); context.Response.ContentType =“application / octet-stream”;
我不知道,下一步该做什么? 因为“WriteFile”不提供写入另一个流的选项?
任何人都可以给我一个线索如何做到这一点?
链接地址: http://www.djcxy.com/p/45895.html上一篇: How to write HttpWebRequest response to browser
下一篇: Download document from google drive using Google Drive API in .net