Solved

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

Posted on 2008-06-13
2
1,368 Views
Last Modified: 2013-11-07
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
Comment
Question by:josephdaviskcrm
2 Comments
 
LVL 5

Accepted Solution

by:
Alex-w474 earned 500 total points
ID: 21782920
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
 

Author Closing Comment

by:josephdaviskcrm
ID: 31467068
Thats what I'm gathering as I search.  Thanks.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question