//string filePath = Server.MapPath("File/") + Session["file"].ToString();//要下載的資源在本機(jī)
創(chuàng)新互聯(lián)專(zhuān)注于網(wǎng)站設(shè)計(jì)、成都網(wǎng)站制作、網(wǎng)頁(yè)設(shè)計(jì)、網(wǎng)站制作、網(wǎng)站開(kāi)發(fā)。公司秉持“客戶(hù)至上,用心服務(wù)”的宗旨,從客戶(hù)的利益和觀(guān)點(diǎn)出發(fā),讓客戶(hù)在網(wǎng)絡(luò)營(yíng)銷(xiāo)中找到自己的駐足之地。尊重和關(guān)懷每一位客戶(hù),用嚴(yán)謹(jǐn)?shù)膽B(tài)度對(duì)待客戶(hù),用專(zhuān)業(yè)的服務(wù)創(chuàng)造價(jià)值,成為客戶(hù)值得信賴(lài)的朋友,為客戶(hù)解除后顧之憂(yōu)。string filePath =@"\192.168.1.90wwwrootimg.cn-school.comimages667027ee9425480e8881fd923158317d.png";//要下載的資源在某個(gè)服務(wù)器
FileStream fs = new FileStream(filePath, FileMode.Open);
byte[] bytes = new byte[(int)fs.Length];
fs.Read(bytes, 0, bytes.Length);
fs.Close();
Response.Charset = "UTF-8";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
Response.BinaryWrite(bytes);
Response.Flush();
Response.End();
return new EmptyResult();
}