A
Anonymous
Guest
I store images in my database, and the return them to to browser using "image.php?id=234" this works fine except for some small problems:
1. When the user wants to save the file, he doesn't get the original filename of the image, how do I send the original filename with the image?
2. I noticed that caching of the images is not really working right now. Probably because the browser thinks that it is an dynamic file, wich can change. But I know for 100% certain that "image.php?id=234" will ALLWAYS be that image.
How do I tell the browser (and proxy's on the way) they can cache the file as long as they want??
I'm currently using the following headers:
where $image['imagetype'] is fetched from the database ofcourse.
Greetz Daan
1. When the user wants to save the file, he doesn't get the original filename of the image, how do I send the original filename with the image?
2. I noticed that caching of the images is not really working right now. Probably because the browser thinks that it is an dynamic file, wich can change. But I know for 100% certain that "image.php?id=234" will ALLWAYS be that image.
How do I tell the browser (and proxy's on the way) they can cache the file as long as they want??
I'm currently using the following headers:
Code:
Header("Cache-Control: public");
Header('Content-type: ' . $image['imagetype']);
Greetz Daan