S
shapper
Hello,
I have a table where I save the info from files I upload to the
server.
All files are renamed to {Guid}.extension.
When the user downloads the file I rename it using the file title
saved on the database:
var file = (from f in database.Files where f.FileId == id select
file).SingleOrDefault();
return new Microsoft.Web.Mvc.BinaryStreamResult
(System.IO.File.OpenRead(Server.MapPath("~/" + file.Path)))
{ FileDownloadName = file.Title };
The problem is when title has characters like ã, õ, á these are
replaced ... and spaces also become +.
For example:
"São à aões.pdf"
Becomes:
"S%c3%a3o+%c3%a0+a%c3%b5es.pdf"
How can I solve this?
Thanks,
Miguel
I have a table where I save the info from files I upload to the
server.
All files are renamed to {Guid}.extension.
When the user downloads the file I rename it using the file title
saved on the database:
var file = (from f in database.Files where f.FileId == id select
file).SingleOrDefault();
return new Microsoft.Web.Mvc.BinaryStreamResult
(System.IO.File.OpenRead(Server.MapPath("~/" + file.Path)))
{ FileDownloadName = file.Title };
The problem is when title has characters like ã, õ, á these are
replaced ... and spaces also become +.
For example:
"São à aões.pdf"
Becomes:
"S%c3%a3o+%c3%a0+a%c3%b5es.pdf"
How can I solve this?
Thanks,
Miguel