Hi Group,
in my aspx page there is an Response.Redirect 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 1814
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.google.c om... Hi Group, in my aspx page there is an Response.Redirect 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.AddHeader("Content-Disposition","attachment;filename=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.google.c om... Hi Group, in my aspx page there is an Response.Redirect 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.net> wrote in message news:<#$**************@tk2msftngp13.phx.gbl>... Some code like this should do the trick. Response.AddHeader("Content-Disposition","attachment;filename=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.google.c om... Hi Group, in my aspx page there is an Response.Redirect 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.google.c om... "Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:<#$**************@tk2msftngp13.phx.gbl>... Some code like this should do the trick.
Response.AddHeader("Content-Disposition","attachment;filename=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.google.c om... Hi Group, in my aspx page there is an Response.Redirect 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.google.c om... "Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:<#$**************@tk2msftngp13.phx.gbl>... Some code like this should do the trick.
Response.AddHeader("Content-Disposition","attachment;filename=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.google.c om... Hi Group, in my aspx page there is an Response.Redirect 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...
|
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...
|
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...
|
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...
|
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: 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,...
|
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,...
|
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...
|
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...
|
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...
|
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...
| |
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...
|
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 ...
|
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...
| |