View Full Version : Link to image download

Time Sheep
10-23-2011, 08:30 PM
Okay, I suppose this is something about the page headers but I weren't quite sure where to put this topic.
I have a PHP script that generates a picture - this picture can only be accessed by linking to the script with the <img> tag.
The problem here lies in 2 places: Browser compatibility and Page Header...
I could live with a solution that let people right click the image and save it to their computer - but Chrome (Probably others too) users just get the result HTML from my script (Which would be empty).
So if I could set the page header of the script to something else, so when you are sent to the script it will begin downloading the jpg file...
Right now, I just use the header "Content-type:image/jpeg"...

EDIT: I just realised this would fit better into the PHP category :S