Re: Downloading a CSV file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

I suggest that you first make the following search in Google :
ie +"mime type"
and then read some.
It will tell you what you are up against.

In summary :
The behaviour of various versions and sub-versions of Internet Explorer with respect to files received from a HTTP server, is variable, erratic, and in most cases conflicts with the specifications of the relevant Internet RFCs. (I am hereby referring to the "Content-type" and "Content-disposition" headers).

In the practice, it means that if you find one set of HTTP headers that works with one IE version/revision, it probably will not do the same with other versions/revisions. In addition, I have found that even with identical versions of IE, sometimes client stations will still react differently, depending on which (other) program is installed on the workstation. (For example, you may find that depending on whether your client has or not MS-Excel installed on his workstation, the behaviour of IE versus your CSV files will change). And since you cannot exactly control which version of IE your client is using, nor the programs installed on his workstation, you're in trouble.

The only way that I have found to get a more or less consistent behaviour, is to "sniff out" the IE version used by the client (see the "User-Agent" request header), and adapt the headers you send in function of that.
It's not pretty and no fun.
It will also probably cost you many hours of lost time explaining the same over and over to your users and their system administrators, hours for which MS will not compensate you.

If anyone else on this list has a different experience and a better solution, please let us know.

Note that this topic has alrady been discussed ad nauseam in a multitude of lists and web discussions, so adding your own complaint will probably just be a drop in the ocean.
But I could not resist warning this new victim.

André

Octavian Rasnita wrote:
Hi,

I've made a program that creates a .csv file and offer it for downloading.

If a user uses Internet Explorer 6 to download the file and it chooses to right-click then "Save as..." from the context menu, the file is downloaded right.

But if the user just clicks or hits enter on the link for downloading that file, the user is asked what he wants to do, to save or open the file, and if he choses that he wants to save it, that window remains open and it doesn't ask for the name of the file.

I've used lwp-request (from ActivePerl) to see which are the HTTP headers received. Please tell me what should I change, add or remove in order to be able to download that file by just clicking on the link.

Thank you.

The headers are:

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0
Connection: close
Date: Sat, 14 Jun 2008 12:09:38 GMT
Pragma: no-cache
Server: Apache/2.2.8 (Fedora)
Content-Length: 4358
Content-Type: text/csv
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Client-Date: Sat, 14 Jun 2008 12:13:49 GMT
Client-Peer: xx.xxx.xxx.xxx:80
Client-Response-Num: 1
Content-Disposition: attachment;filename="REGS--2008-06-13.csv"
Set-Cookie: zzzz=6eb405c4774a704757d6455963ec7bfc10810eb9; domain=www.tranzactiibursiere.ro; path=/
X-Catalyst: 5.7014


Octavian


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux