S
Steve M
Guest
alright, so i know it is all about the headers, and i have looked up a lot of sites and i have had a little luck with this specific problem.
my client wants users to be able to download photos from his site with a dynamically created watermark. it is also necessary to hide the name of the real file so the user cant just go browsing through directories without logging in.
right now, i load the image link from the database by it's id. so the user only sees a query string with an id, and access is restricted to these queries unless you are logged in.
in the php file i create an image dynamically and i place a watermark over the image. i cant save every file on the server with an existing watermark. so i am not sure exactly what i need to include in the header if the image is dynamically created. on my mac it automatically shows the file, but on pc's using ie it prompts the download of the php script used to create the image. any help?
here are my headers for the php script:
switch($fileType) {
case('png'):
header("Content-type: image/png");
imagepng ($sourcefile_id);
break;
default:
header("Content-type: image/jpg");
imagejpeg ($sourcefile_id);
}
my client wants users to be able to download photos from his site with a dynamically created watermark. it is also necessary to hide the name of the real file so the user cant just go browsing through directories without logging in.
right now, i load the image link from the database by it's id. so the user only sees a query string with an id, and access is restricted to these queries unless you are logged in.
in the php file i create an image dynamically and i place a watermark over the image. i cant save every file on the server with an existing watermark. so i am not sure exactly what i need to include in the header if the image is dynamically created. on my mac it automatically shows the file, but on pc's using ie it prompts the download of the php script used to create the image. any help?
here are my headers for the php script:
switch($fileType) {
case('png'):
header("Content-type: image/png");
imagepng ($sourcefile_id);
break;
default:
header("Content-type: image/jpg");
imagejpeg ($sourcefile_id);
}