Jump to content

Save Image As...


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...