中文的文件名,打开时是乱码,英文和数字都是好的
string filePath = Server.MapPath(path);//路径FileInfo fileInfo = new FileInfo(filePath);
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "attachment;filename=" + Name);
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.AppendHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(Name));
补充:.NET技术 , C#