文件名有空格,下载后改变为+,请教!
各位好!
WinXP,.net2003, 采用C#实现下载,如果在文件名称中出现空格,下载后文件名中的空格改变为“+”,请问是什么原因,如何解决?谢谢!文件的下载代码如下:
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" +
HttpUtility.UrlEncode(objFileInfo.Name,System.Text.Encoding.UTF8));
Response.AddHeader("Content-Length", objFileInfo.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(objFileInfo.FullName);
Response.End();
我跟踪的时候,在"Response.WriteFile(objFileInfo.FullName);"时,文件名是正确的,可是下载下的文件名中空格就变成了“+”,请问如何解决?谢谢!