62,075
社区成员
发帖
与我相关
我的任务
分享
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=Status.exe");
Response.BufferOutput = false;
Response.ContentType = "application/exe";
Response.TransmitFile(FullFilePath);
Response.Flush();
Response.End();
string filePath = Server.MapPath("../images/" + filename + ".xml");
String Status = String.Empty;
Status = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><root><Method>sss</Method></root>";
XmlDocument docSave = new XmlDocument();
docSave.InnerXml = Status;
docSave.Save(filePath);
FileInfo fileInfo = new FileInfo(filePath);
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "attachment;filename=Status.xml");
Response.AddHeader("Content-Length", fileInfo.Length.ToString());
Response.AddHeader("Content-Transfer-Encoding", "binary");
Response.ContentType = "application/octet-stream";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
Response.WriteFile(fileInfo.FullName);
Response.Flush();
Response.End();