Hi folks, I'm trying to work out how I can upload an image to a page using curl on the command line.
I'm attempting to migrate a system from a database (that needs decomissioning) to PW, and I've done a fair job of making something that will import data from the CSV exports using some perl to export the data, fix it up and then curl to import into the pages already created.
A lot of these pages have an image(s) associated with them, and I'm struggling to find a good answer on the best way to import the 4500 images. Currently I'm using curl to import the text data to the pages by sending POST requests to the PW edit page (they're all template based), but that doesn't seem to be the instant solution I was hoping for!
I've used Chrome's inspector to try and understand how the AJAX upload works and see if I can use that some way but I've gotten a little lost in that.
As a final thought, if I can't upload directly in this fashion, if I were to host the images elsewhere, is there a way to have the template check for the local version of a file, if it's missing, use some hidden field (I could populate that with a URL per image) to extract an array of URLs, and fetch them so they'd all end up locally?
Thanks for any direction you can point me in!