473,397 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Download file - Name with special chars

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.
Nov 19 '05 #1
1 2598
I think you need to specify Encoding in the Header as well

"Alfredo" <am**********@fullstep.com> wrote in message news:u8**************@TK2MSFTNGP14.phx.gbl...
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.
Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sarah Akers | last post by:
GgF ----gL5cJ72EqiGIQ0SK65Rz Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html> <head> <style type=3D"text/css">.eyebrow { FONT-WEIGHT: bold; FONT-SIZE: 10px; TE=
0
by: Anne Snow | last post by:
7qs ----bSCMEc0pLIbJxmV9 Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html><head><style type=3Dtext/css>.eyebrow { FONT-WEIGHT: bold; FONT-SIZE= : 10px;...
0
by: Lynda Kilgore | last post by:
jGu ----qtHwhORV90yyhqJMOc Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html><head><style type=3Dtext/css>.eyebrow { FONT-WEIGHT: bold; FONT-SIZE= : 10px;...
1
by: Daniel Cardoso | last post by:
I don't know what else to try - In my asp.net app, when the file name has Windows-1252 characters (like ã and ç), these characters appear, each one, as two strange characters in the file name label...
0
by: Jeremy | last post by:
Hi all, I'm using the webclient class in VB.net to download a web page and save it locally. I have a few chars in the html that appear fine when the html page is viewed itself in IE, but...
5
by: Sakharam Phapale | last post by:
Hi All, I am using an API function, which takes file path as an input. When file path contains special characters (@,#,$,%,&,^, etc), API function gives an error as "Unable to open input file"....
0
by: jinnareddy | last post by:
Hi, I'm unable to download a file that is having a 2-byte char in its name (e.g.テ) using force download option. Though, am able to download file names involving ASCII chars. I have tried URL...
1
by: shyaminf | last post by:
hi everybody! iam facing a problem with the transfer of file using servlet programming. i have a code for uploading a file. but i'm unable to execute it using tomcat5.5 server. kindly help me how to...
3
Ciary
by: Ciary | last post by:
hi all, i'm stuck with a rather rare situation. like most some people will know, i've been busy trying to set an uploaded pdf as background image. now, i encountered a new problem. let me explain...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.