MVC下载远程文件流(WebClient)

public ActionResult DownLoad_File()
        {
            
            return File(ScLiu(PathUrl), "application/octet-stream", "sb.pdf");
            
        } 

public Stream ScLiu(string path)
        {
            using (System.IO.MemoryStream memStream = new System.IO.MemoryStream())
            {
                WebClient webClient = new WebClient();
                var obj = webClient.OpenRead(path);
                return obj;
            }
        }

 

posted @ 2015-11-02 14:51  小小高  阅读(1233)  评论(0编辑  收藏  举报