Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking for successful file transfer

Status
Not open for further replies.

ToddWW

Programmer
Mar 25, 2001
1,073
US
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.

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
 
Todd, $XFERSTATUS is only for transfers using modems and file transfer protocols like Zmodem. Additionally, $FTPSTATUS is not as "full-featured" as it could be. I have a sample on my site which transfers the file, then pulls a file listing from the FTP server and looks to see if the file is present. Not the greatest of workarounds, but about the best that I could do in ASPECT.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top