I am using fileContentResult to render a file in a browser. It works fine, except that it throws an exception when the filename contains international characters. I remember reading somewhere that this function does not support international characters, but I’m sure that when an application needs to upload files in countries other than the US, there should be a workaround or best practice experience.
Does anyone know about this practice? Here is the ActionResult method
public ActionResult GetFile(byte[] value, string fileName)
{
string fileExtension = Path.GetExtension(fileName);
string contentType = GetContentType(fileExtension);
return File(value, contentType, fileName);
}
Thank you in advance
Susan
source
share