Mailinglisten-Archive |
> -----Original Message-----
> From: php-admin_(at)_phpcenter.de [mailto:php-admin_(at)_phpcenter.de]On Behalf Of
> Stefan Schiller
> Sent: Tuesday, August 14, 2001 3:17 PM
> To: Php
> Subject: [php] PDF-Download nach redirect
>
>
> Hallo Liste,
Hi Stefan,
> ...
> Warum will der Mx-Explorer das PHP-Script downloaden??
>...
> if(strcmp($center,$perms[$j])==0) {
> $len = filesize("/home/XXX/academies/". $perms[$j]);
> header("Content-type: application/pdf");
> header("Content-Length: $len");
> header("Content-Disposition: attachment;
> filename=" . $perms[$j]);
> _(at)_readfile("/home/XXX/academies/". $perms[$j]);
mit diesem header klappt's bei mir PDF-download.
sogar in beiden browsers und mit dem richtigen size nach dem download ;-)
$name = 'test.pdf';
$filedir = '/usr/local/test/';
if (file_exists($filedir.$name)) {
header("Content-disposition: attachment;filename=$name");
header("Content-type: application/force-download;name=$name");
readfile($filedir.$name);
}
Gruss,
Juri
php::bar PHP Wiki - Listenarchive