how can i stream the content of the image ?

See all posts Reply

how can i stream the content of the image ? new!
by claudiu, 14 years, 4 months ago
hello, can this class open a image from a folder and stream it directly in browser resized or croped.

thank youReply
Re: how can i stream the content of the image ? new!
by colin, 14 years, 4 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
Re: how can i stream the content of the image ? new!
by claudiu, 14 years, 4 months ago
thank you very much it works :)Reply