I\'m trying to send files over ftp and afterwards check if the process was completed successfully, if it was I would delete the original files and keep only the ones sent in
Not sure if this is the best way but you can get a file listing via the FTP
command and compare the results to what you're expecting. Here's an example:
' Create the FTP command file...
With CreateObject("Scripting.FileSystemObject").CreateTextFile("c:\ftp.txt", True)
.WriteLine "USER test"
.WriteLine "testtest"
.WriteLine "ls /htdocs/test/"
.WriteLine "quit"
.Close
End With
' Run the command and capture its output...
With CreateObject("WScript.Shell")
.Run "%comspec% /c ftp -n -v -s:c:\ftp.txt ftp.test.com >c:\filelist.txt", 0, True
End With
This would create the file c:\filelist.txt
, which you could then open and check for the existence of the file(s) you've uploaded. Of course, you can add additional args to the ls
command to get more detailed info. For example, ls -l
would give you the date updated as well as the file size.