I would like to save/open a file from ASP.net.
if (Request.Browser.Browser == "IE" && (Request.Browser.Version == "7.0" || Request.Browser.Version == "8.0" || Request.Browser.Version == "9.0"))
contentDisposition = "inline; filename=" + Uri.EscapeDataString(fileName);
else
contentDisposition = "inline; filename*=UTF-8''" + Uri.EscapeDataString(fileName);
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Charset = "UTF-8";
Response.ContentType = "application/" + mimeType;
Response.AppendHeader("content-disposition", contentDisposition + "." + extension);
With this example áéáá asd.pdf, I get the following áéáá%20asd.pdf.
Instead of %20, i want a simple space.
use string’s replace method, here’s example:
string result = filename.Replace("%20"," ")method