[PHP] setting the name of the file in Save As windows

2001-04-26 Thread Black Dragon

Hi!

I've done a program that send a zip file to browser. I read it on server
using fopen because I've it in a private area (I can't send it directly).

Now I send it to browser in this way:

  header ("Content-type: application/x-zip-compressed");
 $fd = fopen ($filename, "r");
  $data = fread( $fd , filesize ($filename));
  echo ($data);
 fclose ($fd);


This work, but when the user tries to save the file on his disk the script
set as file name the name of itself!

I've tried unsuccesfully to print this header after the first header:

header ("Content-Disposition: attachment; filename=\"WorkPlease.zip\"");

Can you help me?



-- 
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]




[PHP] (SOLVED)Re: [PHP] setting the name of the file in Save As windows

2001-04-26 Thread Black Dragon


> I've tried unsuccesfully to print this header after the first header:
>
> header ("Content-Disposition: attachment; filename=\"WorkPlease.zip\"");
>

It works using:

  header("Content-Disposition: filename=\"WorkPlease.zip\"");

I think my browser is a bit mad :)
the rrf http://www.w3.org/Protocols/rfc2616/rfc2616  says that it must be
used the first one (with attachement)  :(






-- 
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]