Answer the question
In order to leave comments, you need to log in
How to create a script that will upload images to the admin panel?
Good day to all!
The question is: I need a script for a node.js project (located on the computer locally)
that will upload a large number of images (also located locally on the computer)
to the directory of apartments filled on the site (site on the server).
One image corresponds to one apartment in which it will be loaded.
The approximate directory structure is: Directory / Complex / Queue / Section / Floor / Apartments
Is it possible to somehow use puppeteer, headless chrome for this purpose,
so that this happens automatically? Those. let's say I have a folder with images,
I set the site urls I need in the project and the browser loads the images where I need?
There is a list of url, by which editing of apartments is available in the admin panel,
you need the browser to bypass all the specified url's, find the fields (inputs) for loading images and download them.
I searched for information on the network about downloading files through headless chrome, I didn’t really find anything,
there is only information on how to download images.
I would like to automate the process "go to the desired apartment in the admin panel - add a new picture - save the changes."
Can someone tell me which way to look?
Answer the question
In order to leave comments, you need to log in
suddenly someone will be interested, I found such a solution for uploading files using puppeteer
https://pptr.dev/#?product=Puppeteer&version=v4.0....
ummm, "for a local project" in the sense that the pictures are on the computer, and the database is on the computer, and you just need to fill the database with the names of the image files?
An approximate directory structure is as follows: Catalog / Complex / Queue / Section / Floor / Apartments
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question