When the file name is "Algunas MARCAS que nos acompañan" ASP.NET MVC raise an System.FormatException
when I try to download that file. But if the file name is "Asistente de Gerencia Comercial" it doesn't.
I guess this is because something related to UTF-8
encoding, but I don't know how to encode that string.
If I'm right, how can I encode the string in UTF-8
encoding? If I'm not right, what is my problem?
instead of using httpUtility that replaces the spaces in the file name with "+" using the following code resolve the problem:
please note that if you retrieve file name from data set you may need trim the name first! you have to also add the following lines of code in advance: