I am connecting to an FTP site over the internet and transferring a file. How do I check to see if the file transfer was successful. I tried using $XFERSTATUS and $FTPSTATUS with no success. Here is my last script.
The above code fired the $xferstatus block even though the file transfer was successful. When I tried to use the $FTPSTATUS it equated to zero (idle) even though the file transfer had failed. I changed the filename in the FTP REMOTE COPYFILE statement to force the download to fail. Is there a difference between a download failing due to a bad connection and a download failing due to a "File Not Found" error ?
Thanks in advance for your help.
Todd
Code:
dial FTP "manualconnect"
while $ftpstatus == 1
yield
endwhile
if $ftpstatus != 3
pause 2
FTP REMOTE COPYFILE "csx20031105134547.dat"
while $ftpstatus == 1
yield
endwhile
if $xferstatus != 2
; FILE TRANSFER FAILED
endif
else
;FTP CONNECTION FAILED
endif
pause 2
disconnect
The above code fired the $xferstatus block even though the file transfer was successful. When I tried to use the $FTPSTATUS it equated to zero (idle) even though the file transfer had failed. I changed the filename in the FTP REMOTE COPYFILE statement to force the download to fail. Is there a difference between a download failing due to a bad connection and a download failing due to a "File Not Found" error ?
Thanks in advance for your help.
Todd