首页 > Web开发 > 详细

HttpRequest获取文件流,HttpResponse输出文件流

时间:2015-02-12 00:31:07      阅读:1143      评论:0      收藏:0      [点我收藏+]
            HttpResponse输出文件:
            Response.Clear();
            Response.ContentType = "application/octet-stream";
            //通知浏览器下载文件而不是打开
            Response.AddHeader("Content-Disposition", "attachment;   filename=aaa.csv"); 
             var sw = new StreamWriter(response.OutputStream);
            //cc.Write<CustomerData>(list, sw, csvFileDesc);
            sw.Flush();
            sw.Close(); 
 

 HttpRequest获取文件:

 var sr = new StreamReader(request.InputStream); 

HttpRequest获取文件流,HttpResponse输出文件流

原文:http://www.cnblogs.com/bqh10086/p/4287212.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!