1 Reply Latest reply on Feb 26, 2014 6:52 AM by hemanthR

    Script to save gallery images to disc?


      I have created a media pack application but need to find a way for users save some images to disc from within the application? The images are in a gallery and I want to avoid opening another browser window and using the R click > save image as.

        • 1. Re: Script to save gallery images to disc?
          hemanthR Adobe Employee

          It is not possible to download and save the image with javascript alone you also need to use server side scripts too.From javascript you can only initiate a request and it is the server side script which produces the expected result. So in order to download the image you can initiate the ajax request using javascript and in the server side script you have set a http header as shown below which will initiate the download dialog on the browser

          Content-Disposition: attachment; filename="image.jpg";

          Or otherwise you will get it as a binary response from the server. Which again you have to use javascript to write it as a file on the client machine, which is not possible as it is a security violation to write a file via javascript.

          1 person found this helpful