-3

What it must do is whenever the user likes a picture on Instagram, it must find the link to that picture (which can be found in Inspect Element)and then save it in the computer. All this must not be visible to the user. It should just save the photo to the computer as soon as the user "likes" the photo.

Sorry I am new to the field of programming so pardon my vagueness. All helps would be appreciated. Thanks!

  • And your current code is??? – Andrew May 21 '15 at 13:07
  • You're going to get a lot of downvotes if you keep the question that way. You should rephrase it and ask for advice, but it is my opinion that this may be too advanced if you are new to programming. – kemicofa ghost May 21 '15 at 13:11
  • Please change the title of your question! The title should be related to your problem. –  May 21 '15 at 13:12
  • Can you please tell me what i must do so that the question does not get removed? I am new to stack overflow so i don't know how things work here – Arpit Kubadia May 21 '15 at 13:16

1 Answers1

0

If I am interpreting your question correctly, you want to download an image from Instagram on clicking a link/button.

Unfortunately there doesn't seem to be a way to do this because Javascript cannot save to a users computer. A potential would be to set the Content-disposition response header, and just set the window.location to the image link. However, since you want to get the image from Instagram, that's not an option.

References:

File download script doesn't work when called from Ajax

http://www.boutell.com/newfaq/creating/forcedownload.html

Community
  • 1
  • 1
Devin H.
  • 1,065
  • 1
  • 11
  • 19
  • Can i do something like this? First the code inspects the element and finds the link to the image through the designated path It opens the link in a new window. This opens the photograph in the new page Then can i make the program do the equivalent of Right mouse click=> Save image ? All this must happen in the background . Is it possible? Can you please provide helpful links? Thanks! – Arpit Kubadia May 21 '15 at 14:26
  • As I said: Javascript cannot save anything to the user's disk, for security reasons. So, no, it's not possible to emulate right click save. – Devin H. May 21 '15 at 16:46
  • Also, you may want to read about the DOM: https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model. Javascript doesn't use a browser inspect element, it uses the DOM. – Devin H. May 21 '15 at 16:50