Download files automatically with JavaScript

-1

I'm creating a Userscript to back up the various ads I have on a site, first reading the list with the ID of each ad and entering a loop to read the ad for each product in the site, it saves the title, price, description etc in a text file (with FileServer.js).

I'm not sure how to save the images automatically, the images are in JPG and PNG format, if I open the URL with window.open or location.href the image is displayed instead of saved, is there a JavaScript way to download to archive a URL automatically?

    
asked by anonymous 02.07.2018 / 21:35

1 answer

0

I understand your question better, what you want to do does not seem very possible via javascript only (unless you are using node.js on your backend) otherwise, using javascript only, managing a backup system will not be possible, I recommend developing such a function in the backend source code of your system

    
02.07.2018 / 21:56