Forum Moderators: coopster

Message Too Old, No Replies

Files sometimes exporting correctly depending on browser?

exporting as .csv sometimes and .php sometimes

         

javahava

4:39 am on Oct 28, 2004 (gmt 0)

10+ Year Member



I am exporting some data into a .csv format through my website. The program used to work fine, but am finding that on some of my clients' systems, the data isn't outputting correctly (outputting in .php rather than .csv); it still seems to work on some systems, but am having trouble finding the common thread (whether the program works or not, most of the systems are on xp and use the most recent IE). any ideas or suggestions for getting the code to work consistently? anyone experience this problem as well?

kumarsena

7:53 am on Oct 28, 2004 (gmt 0)

10+ Year Member



can u post any relevant code? (such as the part that converts)

k

javahava

8:39 pm on Oct 28, 2004 (gmt 0)

10+ Year Member



This link should open a .csv file which works in some browsers and some it's saving as .php file. I have checked the IE version, it is 6.0 on both places where it works and didn't worked.

The heared I am using is
header ("content-type: application/octetstream text\html charset=big5;\nContent-Disposition: \"inline; filename=$file\"");

And nothing complicated in code, just a while loop to get results from db and appending to a variable and finally out of loop I am using this line of code.

echo "$data\n";

I even checked in FireFox, there it gave error simply.

Hope this cleares you what my problem is.

Thanks in advance!

[edited by: jatar_k at 8:43 pm (utc) on Oct. 28, 2004]
[edit reason] removed url, see TOS [/edit]

javahava

8:50 pm on Oct 28, 2004 (gmt 0)

10+ Year Member



Hey, It works fine in IE browser.

But the problem with FireFox browser.
I am not able to download the .csv file from which works fine in IE.

Can anyone help me in this regards?

Thanks in advance!

[edited by: jatar_k at 8:57 pm (utc) on Oct. 28, 2004]
[edit reason] removed url [/edit]

jatar_k

8:56 pm on Oct 28, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I do something similar and use this code

Generating a CSV for Download from MySQL [webmasterworld.com] msg 9