Hi Group,
in my aspx page there is an Response.Redire ct to a file called myfile.csv.
The file consists of plain text with comma separated values.
I want that the browser opens the save as dialog which it does.
So far so good.
But the filename, the Internet Explorer suggests is not myfile.csv but myfile.xls.
Why does the IE change the file extension?
How can I have the save as dialog with the correct suggestion of the filename?
Any help appreciated,
Winston 5 1835
Winston,
You can probably try to alter the MIME types on the server, but if
you're redirecting to a csv there probably isn't much. IE is probably
identifying the csv with Excel since it is a commonly used file to import
data into Excel or out of it. You can try something like identifying a MIME
type of csv to application/octet-stream so that IE will hopefully be forced
to download it.
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"Winston" <wi***********@ gmx.net> wrote in message
news:a0******** *************** ***@posting.goo gle.com... Hi Group, in my aspx page there is an Response.Redire ct to a file called myfile.csv. The file consists of plain text with comma separated values. I want that the browser opens the save as dialog which it does. So far so good.
But the filename, the Internet Explorer suggests is not myfile.csv but
myfile.xls. Why does the IE change the file extension?
How can I have the save as dialog with the correct suggestion of the
filename? Any help appreciated, Winston
Some code like this should do the trick.
Response.AddHea der("Content-Disposition","a ttachment;filen ame=myfile.csv" );
--
I hope this helps,
Steve C. Orr, MCSD, MVP http://Steve.Orr.net
"Winston" <wi***********@ gmx.net> wrote in message
news:a0******** *************** ***@posting.goo gle.com... Hi Group, in my aspx page there is an Response.Redire ct to a file called myfile.csv. The file consists of plain text with comma separated values. I want that the browser opens the save as dialog which it does. So far so good.
But the filename, the Internet Explorer suggests is not myfile.csv but
myfile.xls. Why does the IE change the file extension?
How can I have the save as dialog with the correct suggestion of the
filename? Any help appreciated, Winston
"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message news:<#$******* *******@tk2msft ngp13.phx.gbl>. .. Some code like this should do the trick. Response.AddHea der("Content-Disposition","a ttachment;filen ame=myfile.csv" );
Hi Steve,
unfortunately not. I tried it and the IE still changes the file
extension from .csv to .xls. Any ideas?
Winston
-- I hope this helps, Steve C. Orr, MCSD, MVP http://Steve.Orr.net
"Winston" <wi***********@ gmx.net> wrote in message news:a0******** *************** ***@posting.goo gle.com... Hi Group, in my aspx page there is an Response.Redire ct to a file called myfile.csv. The file consists of plain text with comma separated values. I want that the browser opens the save as dialog which it does. So far so good.
But the filename, the Internet Explorer suggests is not myfile.csv but myfile.xls. Why does the IE change the file extension?
How can I have the save as dialog with the correct suggestion of the filename? Any help appreciated, Winston
Excel is the default application associated with CSV files.
But it seems you don't want your CSV files associated with Excel?
Can you use another extension besides CSV?
--
I hope this helps,
Steve C. Orr, MCSD, MVP http://Steve.Orr.net
"Winston" <wi***********@ gmx.net> wrote in message
news:a0******** *************** ***@posting.goo gle.com... "Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:<#$******* *******@tk2msft ngp13.phx.gbl>. .. Some code like this should do the trick.
Response.AddHea der("Content-Disposition","a ttachment;filen ame=myfile.csv" );
Hi Steve, unfortunately not. I tried it and the IE still changes the file extension from .csv to .xls. Any ideas?
Winston -- I hope this helps, Steve C. Orr, MCSD, MVP http://Steve.Orr.net
"Winston" <wi***********@ gmx.net> wrote in message news:a0******** *************** ***@posting.goo gle.com... Hi Group, in my aspx page there is an Response.Redire ct to a file called
myfile.csv. The file consists of plain text with comma separated values. I want that the browser opens the save as dialog which it does. So far so good.
But the filename, the Internet Explorer suggests is not myfile.csv but myfile.xls. Why does the IE change the file extension?
How can I have the save as dialog with the correct suggestion of the filename? Any help appreciated, Winston
Is there a public URL that you've got this code running on? I'd like to
look at the Headers.
--
Thanks,
Eric Lawrence
Program Manager
Assistance and Worldwide Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Winston" <wi***********@ gmx.net> wrote in message
news:a0******** *************** ***@posting.goo gle.com... "Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:<#$******* *******@tk2msft ngp13.phx.gbl>. .. Some code like this should do the trick.
Response.AddHea der("Content-Disposition","a ttachment;filen ame=myfile.csv" );
Hi Steve, unfortunately not. I tried it and the IE still changes the file extension from .csv to .xls. Any ideas?
Winston -- I hope this helps, Steve C. Orr, MCSD, MVP http://Steve.Orr.net
"Winston" <wi***********@ gmx.net> wrote in message news:a0******** *************** ***@posting.goo gle.com... Hi Group, in my aspx page there is an Response.Redire ct to a file called
myfile.csv. The file consists of plain text with comma separated values. I want that the browser opens the save as dialog which it does. So far so good.
But the filename, the Internet Explorer suggests is not myfile.csv but myfile.xls. Why does the IE change the file extension?
How can I have the save as dialog with the correct suggestion of the filename? Any help appreciated, Winston
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: zfeld |
last post by:
My app is creating a word document which my app calls saveas() and saves it
to a given directory that is being watched by a fileSystemWatcher. The
problem is that the fileSystemEventHandler for creation is only called for
the temporary filed created by word which shows up as ~$documentName.doc the
real file named MyDocument.doc will never invoke the fileSystemEventHandler
for creation. Now when the user closes Word the temporary file is...
|
by: David Kenneally |
last post by:
Hello-
I'm having a problem doing a file upload from within the edit function
of a datalist. I have a simple file upload that works on a standard
..net page:
<td width="53"><input id="inpFileUp" type="file" runat="Server"
/> </td>
<asp:Button id="Button1" onclick="Button_Click2" Runat="Server"
Text="Upload File!"></asp:Button>
|
by: zfeld |
last post by:
My app is creating a word document which my app calls saveas() and saves it
to a given directory that is being watched by a fileSystemWatcher. The
problem is that the fileSystemEventHandler for creation is only called for
the temporary filed created by word which shows up as ~$documentName.doc the
real file named MyDocument.doc will never invoke the fileSystemEventHandler
for creation. Now when the user closes Word the temporary file is...
|
by: Hamayun Khan |
last post by:
I have Two asp pages
addfiles.asp
insert.asp
addfiles.asp is used to browse the files which i want to upload to server.
in IE both the pages run and the files uploads ok.
There is problem in firefox.
|
by: Sabine Dinis Blochberger |
last post by:
Johnson Scaria John wrote:
Reply and Follow-up to comp.lang.javascript
--
Sabine Dinis Blochberger
Op3racional
www.op3racional.eu
| |
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: 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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |