Hello all,

i tried to make the browser save a file by setting headers

In this case the Browser (IE 5.5 W2K) just displays the content,

http request
T4 09/07 11:03:17 Server Data: GET http://iwonttell/
T4 09/07 11:03:17 Server       ausgabe/auswertung.php
HTTP/1.0{0D}{0A}Accept:
T4 09/07 11:03:17 Server       */*{0D}{0A}Accept-Language:
de{0D}{0A}Authoriza
T4 09/07 11:03:17 Server       tion: Basic
aWFdonteventhinkVtbTQy{0D}{0A}User-Ag
T4 09/07 11:03:17 Server       ent: Mozilla/4.0 (compatible; MSIE 5.5;
Windows
T4 09/07 11:03:17 Server        NT 5.0){0D}{0A}Host:
www.rtl.de{0D}{0A}Proxy-C
T4 09/07 11:03:17 Server       onnection: Keep-Alive{0D}{0A}{0D}{0A}

response
T4 09/07 11:03:18 Server Data: HTTP/1.1 200 OK{0D}{0A}Date: Fri, 07 Sep
2001 0
T4 09/07 11:03:18 Server       9:03:49 GMT{0D}{0A}Server: Apache/1.3.19
(Unix)
T4 09/07 11:03:18 Server        PHP/4.0.5{0D}{0A}X-Powered-By:
PHP/4.0.5{0D}
T4 09/07 11:03:18 Server       {0A}Content-Disposition: attachment;
filename=a
T4 09/07 11:03:18 Server
usgabe_2001-09-07{0D}{0A}Content-Description: S
T4 09/07 11:03:18 Server       pielerdaten IAA
Special{0D}{0A}Connection: clos
T4 09/07 11:03:18 Server       e{0D}{0A}Content-Type:
text/plain{0D}{0A}{0D}
T4 09/07 11:03:18 Server       {0A}2001-09-07;jens;auch;test{0A}

and in this case (other Web-Server) it works (same browser)

http request
T4 09/07 11:06:22 Server Data: GET
http://bigmama/projekte/rtl/formular/ausgab
T4 09/07 11:06:22 Server       e/auswertung.php HTTP/1.0{0D}{0A}Accept:
image/
T4 09/07 11:06:22 Server       gif, image/x-xbitmap, image/jpeg,
image/pjpeg,
T4 09/07 11:06:22 Server       application/vnd.ms-excel,
application/msword, a
T4 09/07 11:06:22 Server       pplication/vnd.ms-powerpoint,
*/*{0D}{0A}Accept
T4 09/07 11:06:22 Server       -Language: de{0D}{0A}Cookie:
mailCookie=jens%40
T4 09/07 11:06:22 Server       bigmama.rep{0D}{0A}User-Agent:
Mozilla/4.0 (com
T4 09/07 11:06:22 Server       patible; MSIE 5.5; Windows NT
5.0){0D}{0A}Host:
T4 09/07 11:06:22 Server        bigmama{0D}{0A}Proxy-Connection:
Keep-Alive
T4 09/07 11:06:22 Server       {0D}{0A}{0D}{0A}

response
T4 09/07 11:06:22 Server Data: HTTP/1.1 200 OK{0D}{0A}Date: Fri, 07 Sep
2001 0
T4 09/07 11:06:22 Server       9:06:22 GMT{0D}{0A}Server: Apache/1.3.14
(Unix)
T4 09/07 11:06:22 Server         (SuSE/Linux) mod_throttle/3.0
mod_layout/1.0
T4 09/07 11:06:22 Server       mod_fastcgi/2.2.2 mod_ssl/2.7.1
OpenSSL/0.9.6 P
T4 09/07 11:06:22 Server       HP/4.0.4pl1{0D}{0A}X-Powered-By:
PHP/4.0.4pl1
T4 09/07 11:06:22 Server       {0D}{0A}Content-Disposition: attachment;
filena
T4 09/07 11:06:22 Server
me=ausgabe_2001-09-07{0D}{0A}Content-Descriptio
T4 09/07 11:06:22 Server       n: Spielerdaten IAA
Special{0D}{0A}Connection:
T4 09/07 11:06:22 Server       close{0D}{0A}Content-Type:
text/plain{0D}{0A}
T4 09/07 11:06:22 Server
{0D}{0A}2001-09-07;jens;test;test{0A}2001-09-07
T4 09/07 11:06:22 Server
;jens;test;test{0A}2001-09-07;jens;test;test
T4 09/07 11:06:22 Server       {0A}2001-09-07;jens;test;test{0A}

The only difference i see is htaccess authentication on the second
Server...
The PHP Code used to pipe the file through the browser is

 $file=fopen("ausgabe_".strftime("%Y-%m-%d",$time).".csv", "r");
 header("Content-type: text/plain");
 header("Content-Disposition: attachment;
filename="."ausgabe_".strftime("%Y-%m-%d",$time)."");
 header("Content-Description: Spielerdaten IAA Special");
 fpassthru($file);

Any ideas whats wrong here?

thanks in advance

--
Grüße aus dem schönen Kleve
Jens Kisters

rosomm et partner
Agentur für neue Medien GmbH
Dienstleistungszentrum am
Weißen Tor - Eingang B
Gocher Landstrasse 2
47551 Kleve / Bedburg-Hau

Telefon: 02821 - 97856-20
Telefax: 02821 - 97856-77
[EMAIL PROTECTED]
http://www.rosomm-partner.de



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to