How to write HttpWebRequest response to browser
I am trying to achieve this:
user buy files, click on the link and i do this:
var filename = "SomeHighlySecureFile.mp3"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://myfiles.com/download.aspx?file=" + filename); HttpWebResponse response = (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";
I have no idea, what to do next? coz the "WriteFile" does not provide the options to write another stream?
Can anyone give me a clue how to do that?
链接地址: http://www.djcxy.com/p/45896.html上一篇: 在solr上获得错误的请求(400)