Hi all
I am using the following to pass a file to the client
snip
header(Content-type: . $row['filetype'] );
$path = ROOT_PATH . file_uploads/;
$real_filename = $path . $row['location'] . '/' .$row['filename'];
header(Content-Disposition: attachment; filename= . $row['filename']);
I'm trying to figure out how to make readfile() or include() work more
like a server-side #include, in terms of HTTP headers.
I'm taking some web pages that used server-side includes, that in turn
invoked CGI scripts, and replacing these pages with PHP pages. For the
most part, I don't need a lot
I'm trying to figure out how to make readfile() or include() work more
like a server-side #include, in terms of HTTP headers.
I'm taking some web pages that used server-side includes, that in turn
invoked CGI scripts, and replacing these pages with PHP pages. For the
most part, I don't need a
I found info on php.net about how to set content type for a file then
cause it to be a downloaded file. So far it's been working for showing
everything until I tried having it display a jpeg. Here's the code I have -
header(Content-type: .$atype);
readfile(include($afile));
The only problem
At 13:45 24.02.2003, Patrick Teague said:
[snip]
readfile(include($afile));
[snip]
You don't need to include the file you're going to read... simply give
readfile($file)
and you'll be set.
include() tries to
Show us code. The error refers to line 87. We need to see that, and other code
surrounding 87.
- Original Message -
From: Patrick Teague [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 24, 2003 6:45 AM
Subject: [PHP] Problem with readfile on jpegs
I found info
Hi,
I'm trying to use readfile to send a file to the browser. The code I'm using
is:
header("Content-length: $size");
header("Content-type: $type");
header("Content-disposition: attachment;filename=$filename");
readfile($filename);
It works fine for very small files, but for larger files it
7 matches
Mail list logo