Jump to content

JimmyGulp

Members
  • Posts

    4
  • Joined

  • Last visited

JimmyGulp's Achievements

Newbie

Newbie (2/6)

0

Reputation

  1. Many thanks again all for your direction and code snippets. Used @millipedia's code and expanded that, which also allowed me to import the other useful data in the data export to do a nice big single import (about 10minutes to do the whole thing on a local copy, the remote one via AWS is taking a little longer), and a heck of a lot faster than using curl and fishing out the TOKEN bits to work around the CSRF protection! Now just to put something together that'll do the bits this script missed (pages hadn't been created at the time, etc etc), but I've got a good head start on where I was!
  2. Thanks Millipedia, that looks to be a great way to do the import, thank you for the example, I really appreciate it!
  3. Ah, good thinking, I'll have a look down that route and see where it leads me 🙂
  4. 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!
×
×
  • Create New...