[SOLVED] apache server and csv files issue with IE
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Not sure where this belongs. Might be apache related, might be IE related or might be Windows related.
The basic question is why Internet Explorer thinks (or is told) that a csv file is a zip file when the user clicks on a link to the file. Is it IE's intelligence or is there something on the server that needs to change. Firefox (under windows) does not suffer from this. And this only happens with files starting with PK (yes, I know)
The files are served from an apache webserver via https.
Can this be a mime type issue? I'm not sure how mime types work; does the server tell the client something about it? There is definitely no reference to csv and the default mime type is text/plain. Also, the fact that FF does not suffer from it does not point in the direction of mime types (but I might be totally wrong).
Any pointers? For now I have modified how the files are generated, but it's not really a satisfying solution as this can happen again when I forget about it.
Distribution: Debian for Sparc, OpenSUSE 11.2, Solaris 9, Debian/x86, Ubuntu Server
Posts: 19
Rep:
Quote:
Originally Posted by Wim Sturkenboom
Not sure where this belongs. Might be apache related, might be IE related or might be Windows related.
The basic question is why Internet Explorer thinks (or is told) that a csv file is a zip file when the user clicks on a link to the file. Is it IE's intelligence or is there something on the server that needs to change. Firefox (under windows) does not suffer from this. And this only happens with files starting with PK (yes, I know)
The files are served from an apache webserver via https.
Can this be a mime type issue? I'm not sure how mime types work; does the server tell the client something about it? There is definitely no reference to csv and the default mime type is text/plain. Also, the fact that FF does not suffer from it does not point in the direction of mime types (but I might be totally wrong).
Any pointers? For now I have modified how the files are generated, but it's not really a satisfying solution as this can happen again when I forget about it.
This sounds like a MIME type issue, but for some reason I am not thinking this is since those are usually set as file associations in Windozzzze I am going to say that this would probably be an issue with IE itself, and since .CSV files are, for all intents and purposes, plaintext files.
I've added AddType text/plain .csv in the apache conf and it did not make a difference.
I have moved the file to an Apache server on the internet (at my ISP, the other one was on the intranet) and it did not make a difference.
I have tried to convert the file to DOS format (CR/LF) as a final straw and it did not make a difference.
Only option left is to try to get the file on an IIS server and see what happens. After that it's time to file a bug report with Microsoft
The solution came after the file was loaded on a colleagues IIS server and IE all at a sudden decided that it was no longer a compressed file.
Added the below line to apache's http.conf
Code:
AddType application/octet-stream .csv
IE as well as Firefox now offer to open the file in excel (or OOo in Linux) or to save it.
No need to bug Microsoft with a bug report (although I still think it's a bug ); I can spent that time on trying to understand how the interaction between browser and server works.
Anybody an useful link for that? And preferably not a pile of RFCs I did try to research before I posted but have not found a link that exactly states how mime types are used in the 'file transfer'.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.