- Code: Select all
# Tell the broswer that the file coming up is Jpeg/Jpg
header("Content-Type: image/jpeg");
# Tell the browser to assign the file a proper name isntead of the PHP file's name
header("Content-Disposition: inline; filename=\"$ImgName\"");
# Direct the browser to the image itself
header("location: $image_path");
Streaming PHP image files (jpg, jpeg, gif) with original filenames rather than PHP file's name. Uses content headers, disposition, location, content-type.


