We want to upload a file directory tree (a website) to an FTP site, but 3 of the subdirectories contain a large number of image files that change very infrequently, so we want to leave those out. We also want to delete everything (except those 3 subdirectories) before uploading, in keeping with good deployment practices. In sum, we want to upload the files in the root directory, plus all subdirectories except 3 of them, deleting first wherever we upload.
Seems simple enough, but I can't seem to make that happen.
I learned from another post how to delete all the files in a directory without recursively deleting all subdirectories (thank you Angus). That takes care of the root directory. My plan for deleting all the subdirectories except 3 was to perform an FTP List Directory, saving the results to a variable, and then issue an FTP delete directory inside a list iterator, checking the name of the directory inside the loop to exclude the 3 image directories mentioned above.
The problem is the FTP list directory brings back just the files if you put "*.* in the file spec, but it brings back BOTH files and directories if you leave the file spec blank, even though a label on the dialog box states that leaving the file spec blank will bring back ONLY directories. Since I have no way of distinguishing between files and directories, and no way to list just directories - I'm stuck.
What am I doing wrong? Or is there another way to make this happen? I'm flexible on the approach, except we must (1) exclude the 3 image directories and (2) we must delete existing FTP data first; using the upload-changed-files-only approach is not acceptable.
Thanks,
BillyB