Hello,
I need to display or propose a jpeg image on a web page.
When I need to display the image, I use this code :
header("Content-Length: $fileSize") ;
header("Content-Type: $type") ;
header("Content-disposition: inline") ;
header("Location: $imageURL");
And when I need to propose the image to save, I use this one :
header("Content-Length: $fileSize") ;
header("Content-Type: $type") ;
header("Content-disposition: attachment; filename=\"$fileName\"") ;
header("Location: $imageURL");
Everything is working fine, but now, I also need to hide the real path ofthe
image on the server.
So instead of the header(Location: ...), I can use readfile, and this work.
But I'm not sur that is a good solution for a website, if I need to serve
multiple jpeg files of 4~5 Mb each...
My questions are :
- Is the readfile cpu consumption is really more important than serving
directly the image url with apache ?
- Is there a limit in php with the number of readfile calls, like number of
file pointers opened by fopen() ?
What is the difference with readfile and fpassthru ?
Thanks.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGpebxN5PdEh7mYkIRAufhAJ0d/AB+5cWA4K+HQyA/4gPg+24rUQCghgS3
cprQ8Li8VE7snNk0mvPl/04=
=INGB
-----END PGP SIGNATURE-----