Re: File Open Prompt?

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

 



are u shure, u dont send anything out before u send the headers? even one
space would be too much.

ralph_deffke@xxxxxxxx

"Dan Shirah" <mrsquash2@xxxxxxxxx> wrote in message
news:a16da1ff0908281328k641ea332v25d887c4de5b347c@xxxxxxxxxxxxxxxxx
> >
> > You will need to add some headers to the page to popup the prompt, at
least
> > with
> > these.
> >
> > $filename = 'somefile.tif';
> > $filesize = filesize($filename);
> >
> > header('Content-Type: application/force-download');
> > header('Content-disposition: attachement; filename=' . $filename);
> > header('Content-length: ' . $filesize);
> >
> > Eric
> >
> >
>
> I don't know what I'm doing wrong.  I've tried:
>
> header('Content-Description: File Transfer');
> header('Content-Type: application/force-download');
> header('Content-Length: ' . filesize($filename));
> header('Content-Disposition: attachment; filename=' . basename($file));
> readfile($file);
> AND
>
> if (file_exists($new_file)) {
>     header('Content-Description: File Transfer');
>     header('Content-Type: application/octet-stream');
>     header('Content-Disposition: attachment; filename='.basename($new_file
> ));
>     header('Content-Transfer-Encoding: binary');
>     header('Expires: 0');
>     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
>     header('Pragma: public');
>     header('Content-Length: ' . filesize($new_file));
>     ob_clean();
>     flush();
>     readfile($new_file);
>     exit;
> }
>
> But everything I do just sends heiroglyphics to the screen instead of
giving
> the download box.
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux