473,517 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C#-Web-IE7.0 Problem with correct coding of text of filename in download file form

2 New Member
Hello

There is a possibility to show DownloadFile form in web browser using following peace of code
Expand|Select|Wrap|Line Numbers
  1. HttpContext context = HttpContext.Current;
  2. context.Response.ContentType = "application/octet-stream";
  3. context.Response.AddHeader("Content-Disposition","attachment; filename=\"" + fileName + "\"");
  4.  
but there is somenthing missing because when I use filename with "#" it's displayed in wrong way as "_" in IE 7.0 (in firefox is OK). You have a choice in this window to save and to open the file. When you want to save -> filename will be wrong, when you choose to open filename in eg. word filename shown at the top of the window of word will be ok.

So I used ascii code of # then it save correct filename but when I choose to open it in word it filename has ascii codes.

I assume that I should give correct coding type somewhere in this peace of code ... but I don't know where. Can you help me ?
Aug 17 '07 #1
0 1130

Sign in to post your reply or Sign up for a free account.

Similar topics

4
7416
by: Lauren Quantrell | last post by:
I have created the following trigger: CREATE TRIGGER ON OutputTable FOR INSERT AS Declare @filename nvarchar(35) Declare @filecontents nvarchar(2000) Declare @strcmdshell varchar(150)
6
6060
by: nate | last post by:
Hello, Does anyone know where I can find an ASP server side script written in JavaScript to parse text fields from a form method='POST' using enctype='multipart/form-data'? I'd also like it to parse the filename. <form name='form1' method='POST' enctype='multipart/form-data' action='sub.asp'> <input type='text' name='title1'...
0
1665
by: Ilia Makarenko | last post by:
Hi everyone! I've got a problem with IIS 6.0 when downloading files with size > 4 Mb. So I am trying to download file in chunks, but it doesn't work. Only pert of the file is downloaded (~6.5 of 22.5 Mb). Here is the code: .... ext = right(filename, 3)
0
1271
by: umesh | last post by:
Hi, I am using MicroSoft.NET Framework 1.1 Version 1.1.4322 on Japanese Windows 2000. In my application, I have given user facility to upload and download the files. If FileName is Japanese and greater than 17 characters, then the filename does not appear in file download dialog box.
0
1109
by: ben | last post by:
The "Download file" dialogue prompts the user twice if Open is pressed when using Content-Disposition 'attachment' if, and only if, the script was submitted from a form. If Save As is pressed you don't get the prompt a second gtime btw. If the script is simply executed from a querystring the dialogue appears only once as you would expect....
0
2020
by: bonita | last post by:
If I add the code for user to download the file (e.g. if(File.Exists(FILE_NAME)){......}), the ASP.NET will give the following timeout error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. It seems that the download file code is executing before letting the previous code...
16
3224
by: matt | last post by:
I have used some free code for listing files for download, but I want to send an email to the administrator when the file has been downloaded. I have got some code in here that does it, but it will not print in the username or email amddress of the person doing the download - which I am collecting from a form on the previous page. I can get...
0
1005
by: Darqer | last post by:
Hello There is a possibility to show DownloadFile form in web browser using following peace of code Code: ( text ) HttpContext context = HttpContext.Current; context.Response.ContentType = "application/octet-stream"; context.Response.AddHeader("Content-Disposition","attachment; filename=\"" + fileName + "\"");
2
1268
by: manirajmurali | last post by:
hi all, i have face this problem more 3 days.. if anybody help me.. i have upload file through php coding .. i have download that same file from server.. its coming empty file.. i dont know why its coming... its correctly working in local system.. but not working server. Linux server its very urgent.. pls reply me. Its Upload...
0
7289
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7190
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7423
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7594
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7153
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7554
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
4781
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1636
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.