Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1433
  • Last Modified:

Javascript - Simulate 'right click=>save as' to save an image on a page to a place on user's computer.

This is a dual question actually.  My purpose is to save all of the images on a page to a specific directory on the user's computer upon request.  I know I have seen in web pages, the ability to click on a button that says 'browse' for instance, and a little Windows explorer window pops up allowing you to navigate to a specific destination on your hard drive.  That is usually to find a file to upload however.  I'm wondering if I can do such a thing to select a directory to save a file to and if it can be done with javascript or what is used to do it.  If not in javascript, then in ASP.NET?  The application is actually an ASP.NET application.  Secondly, I'm wondering if it is possible to use javascript to simulate a left click on an image and saving it to the above mentioned (browsed to) location.  I would like to be able to do all this with just a browse to field and a button to execute the operation.  The user should not need to right click and save.  Once again, I have ASP.NET and javascript to use.  Any suggestions?
0
josephdaviskcrm
Asked:
josephdaviskcrm
1 Solution
 
Alex-w474Commented:
You cannot simulate this behavior because of security considerations.
You can only redirect user's browser to server script (or file) that returns archive with all images. In this case browser will handle the file and will show the "Save As..." dialog for user (for archives) or just show the image (if you just redirects to image.)
0
 
josephdaviskcrmAuthor Commented:
Thats what I'm gathering as I search.  Thanks.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now