提问,为何会多一个[1]?
使用如下代码,完成输出文件到客户端,提供下载。但是在文件名如:
EasyBoot.Systems.UltraISO.v6.0.rar
这种由多个点分隔的文件名输出到客户端保存时文件名就变成了:
EasyBoot[1].Systems.UltraISO.v6.0.rar
找了很多帖子,也没发现有提到的。
请问如何解决啊?
Response.Clear();
//Add the header that specifies the default filename for the Download/SaveAs dialog
Response.Charset = "UTF-8";
Response.ContentEncoding = System.Text.Encoding.Default;
orgName = HttpUtility.UrlEncode(orgName).Replace("+", "%20");
Response.AppendHeader("Content-Disposition", "attachment; filename =" + orgName);
//Add the header that specifies the file size, so that the browser can show the download progress
Response.AddHeader("Content-Length", f.Length.ToString());
//Specify that the response is a stream that cannot be read by the client and must be downloaded
Response.ContentType = "application/octet-stream";
// Send the file stream to the client
Response.WriteFile(f.FullName);
// Stop the execution of this page
Response.End();