473,748 Members | 2,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Correct coding in IE Download window form

2 New Member

There is a possibility to show DownloadFile form in web browser using following peace of code
Code: ( text )

HttpContext context = HttpContext.Cur rent;
context.Respons e.ContentType = "applicatio n/octet-stream";
context.Respons e.AddHeader("Co ntent-Disposition","a ttachment; filename=\"" + fileName + "\"");

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 23 '07 #1
0 1012

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

Similar topics

by: Programatix | last post by:
Hi, I'm working on a project which includes XML WebServices and Windows Form application. The Windows Form application will call the XML WebServices to retrieve data from database. The data will be returned as DataSet. Now, here's the problem. On .NET Framework 1.1, if any rows in the dataset returned contain errors (marked by calling the SetColumnError() method or
by: ajaykrishna | last post by:
Hi I'm using ASP.NET for my application. In one of the place, I am downloading data to excel document. But, here the File Download window is opening twice in some systems and some system opens it only once (which is correct). Could anyone help resolving this problem? Does this problem is due to some browser settings? Thanks in Advance Ajay --- Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website:...
by: gb | last post by:
hi, i placed System.Windows.Forms.WebBrowser in my WinForm. When i tried loading word document, it opens the File Download window. My question is how can i avoid the File Download window from showing? My intented default action is to always open Open file, just like if i load image, text file or xml file where it does not show the File Download dialog. I dont want to override user preference to always show File Download window.
by: Kueishiong Tu | last post by:
I have a .net window form application but I have to get data from various web sites. How do I make Http request (preferrably via post method) from a window form to get the data from those web sites? What namespace and dll do I have to include? A walkthrough and coding example will be helpful. ...
by: david | last post by:
I have written the Web Services in VBaic .Net. One function interface: DataSet GetAllPatients() which will be called in remote client and return DataSet. I have written the clients by using both C# and VB, and they work fine. Due to some reason, I have to use C++ in .NET IDE. Now I confuss with the use of pointer. I have trouble in coding and compiling. The following is my simple code, anyone could be kind of helping me to figure out the...
by: martin1 | last post by:
All, is there window form refresh property? I try to set up window form refresh per minute. Thanks
by: Melisa | last post by:
Hi, How can i create bitmap of a window form with all its child controls without showing this form? 1. I am trying to create bitmap image of a window form. 2. I am creating a new instance of Form at runtime. 3. Then adding several controls like Button, RadioButton,CheckBox etc to it. 4. Now i want to create bitmap with all controls showing on it which are added to this form.
by: Darqer | last post by:
Hello There is a possibility to show DownloadFile form in web browser using following peace of code HttpContext context = HttpContext.Current; context.Response.ContentType = "application/octet-stream"; context.Response.AddHeader("Content-Disposition","attachment; filename=\"" + fileName + "\""); 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...
by: =?Utf-8?B?bWFydGluMQ==?= | last post by:
All, I present some data on the window form, then I try to save window form as file on the local C drive, like save word file, can anyone know how? Thanks, Martin
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.