In order to make the script as easy as possible to use I made some modifications.
- The script checks the referrer page to determine what file to upload. No user input necessary.
- I created a loop to ensure that the destination directory(ies) exist so no copy errors are encountered.
- I added a RegEx that filters the body for image tags, grabs the
src
attribute, and uploads those images as well.
I may make a further modification to the original script that uses a RegEx to grab all externally referenced files. These would then be presented back in a selection list to the user. This will make it easier to queue a page because I won't have to queue each individual element of the page separately.