Reply to Re: how can i stream the content of the image ?

Re: how can i stream the content of the image ? new!
by colin, 13 years, 10 months ago
As per the doc:

How to output the resulting file or picture directly to the browser?
Simply call process() without an argument (or with null as first argument):
$handle = new upload($_FILES['image_field']);
header('Content-type: ' . $handle->file_src_mime);
echo $handle->Process();
die();

Or if you want to force the download of the file:
$handle = new upload($_FILES['image_field']);
header('Content-type: ' . $handle->file_src_mime);
header("Content-Disposition: attachment; filename=".rawurlencode($handle->file_src_name).";");
echo $handle->Process();
die();
Reply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important