FTP a folder
I do know how to send a single file to an ftp site. Does anyone know if it is possible, and how, to send a folder and its contents including sub-folders, to an ftp site, preserving the folder structure? Using REBOL of course; I can get the job done with filezilla but I want to automate the process. Thank you.
posted by: Steven White 4-Feb-2015/12:31:11-8:00
Just create a little recursive function that goes through all of the files in a folder and either creates and enters each existing folder and/or copies each existing file. There are several examples in my tutorials. I'll try and point to one when I'm not on mobile. You could also create a rip file of the directory structure and then unrip it on the server.
posted by: Nick 4-Feb-2015/15:33:51-8:00
Well, well, I didn't think it would be that easy. I thought that a recursive something-or-other would be the way to go, but I didn't really know how to go about it. However, some time ago I harvested from the internet a short function by Gregg Irwin that recursively copies one directory to another. Just for fun, I tried it, with an ftp:// URL as the destination directory, and by George it worked perfectly. It was a jaw-dropping experience to perform that operation in eleven lines of code. Thank you.
posted by: Steven White 4-Feb-2015/17:33:28-8:00
|