Download file - Name with special chars

A

Alfredo

Hi,

I use the following code to allow my users to download files in my site:

Response.ClearContent()
Response.ClearHeaders()
Response.AddHeader("Content-Disposition", "attachment; filename=""" &
Session("sFileName") & """")
Response.ContentType = "application/x-msdownload"
Response.WriteFile(Session("sFilePath"))

The code works perfectly if file names doesn't include special characters
(i.e. "á", "é", etc.) When these characters are included in the name, they
are changed for others in the "open/save" box (i.e. it changes "reunión" for
"reunión")

Do you know any workaround for this issue??

Using VS2003 with updated .NET Framework 1.1.

Thanks in advance.
 
G

George

I think you need to specify Encoding in the Header as well

Hi,

I use the following code to allow my users to download files in my site:

Response.ClearContent()
Response.ClearHeaders()
Response.AddHeader("Content-Disposition", "attachment; filename=""" &
Session("sFileName") & """")
Response.ContentType = "application/x-msdownload"
Response.WriteFile(Session("sFilePath"))

The code works perfectly if file names doesn't include special characters
(i.e. "á", "é", etc.) When these characters are included in the name, they
are changed for others in the "open/save" box (i.e. it changes "reunión" for
"reunión")

Do you know any workaround for this issue??

Using VS2003 with updated .NET Framework 1.1.

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top