ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Need help writing a script? Have any question about ScriptFTP?
Hi,
I need to be able to delete files within a local directory with a file size of 0, and then upload the remaing files to a remote FTP server. I've had a look at the GETFILESIZE, but strugging where to go from there.
Any help would be greatly appreciated!

Thanks.
Hi Neil,

Try the following:
Code: Select all# Change current remote directory CHDIR("/myremotedirectory/") # Retrieve remote file listing GETLIST($list, REMOTE_FILES) # For each file in the retrieved list FOREACH $file IN $list # If file size is 0 delete the remote file IF(GETFILESIZE(REMOTE,$file)==0) DELETEFILE($file) END IF END FOREACH