Jump to content

Save Image As...


Shade

Recommended Posts

If you have server-side scripting (ASP, PHP, etc.) something like that is possible, but, like DD said, not with javascript alone. The steps would be something like:1) User clicks on the image which sends a request to a special page on your server with the image name in the query string. Something like "saveas.php?file=image.jpg".2) The special page then checks the query string to see what file to load, goes to the IO to find the file, and loads it up into memory.3) The special page then sets a few Response headers - the content-type depends on the actual file being used:

Content-Disposition:attachment; filename=image.jpgContent-Type:image/jpg
4) Finally, the special page then writes the contents of the file to the Response output stream and the user gets prompted with a message asking whether they want to Open or Save the file.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...