Jump to content


Photo

Removing files after download


  • Please log in to reply
2 replies to this topic

#1 Hamilton345

Hamilton345
  • Members
  • 10 posts

Posted 07 April 2007 - 12:47 AM

I am trying to use the DownloadDirectory.wsf script to move files from a remote server to my local machine. However, this script only copies files. I would like to remove the files from the remote server after I have downloaded them. I am using the library to do this.

Thanks

Scott

#2 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 07 April 2007 - 12:52 AM

Hello...

Just call the DeleteFile() function after the file is transferred.

In the Shared.vbs you would add the objFTP.DeleteFile(strFile) function before the bRet = true:

result = objFTP.DownloadFile(strFile, strLocalFile, nRestart, 0)
If result = ftpErrorSuccess Then
bRet = true
Else

But before you delete the file I strongly recommend you to check whether the file has been transferred correctly (by comparing the local/remote file size, file integrity checks).

Regards,
-Mat

#3 Hamilton345

Hamilton345
  • Members
  • 10 posts

Posted 10 April 2007 - 08:37 PM

Thank you




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users