Launch Script after Transfers Complete

Posts: 3
Joined: Fri Aug 19, 2011 8:10 pm

Launch Script after Transfers Complete

Post by JBC » Thu Sep 01, 2011 4:58 pm

Hi again,

I was wondering if there was a way to launch a script after the jobs in the transfer queue have completed.

I am attempting to run a script after uploading the contents of a folder to a server. It would appear though, that TransferQueueOperation_OnEnd() is called after it adds the files from the folder into the queue. It does not wait for these files to be uploaded as one would expect. Is there an event I can use in my script that would activate once all files from this scheduled task have been successfully transferred?


Code: Select all

Sub TransferQueueOperation_OnEnd()

  ScriptHost.Echo "OnEnd"


set Item = TransferQueueOperation.TransferQueueItem

set fso=CreateObject("Scripting.FileSystemObject")

call Item.LogWithCreate.Add(sfTransferQueueItemLogItemTypeInfo, "Sending Uploaded files to Archive")

fso.MoveFile "E:\FTPDownload\SmartFTP\Upload\*.csv", "E:\FTPDownload\SmartFTP\Upload\UploadArchive\"

call Item.LogWithCreate.Add(sfTransferQueueItemLogItemTypeInfo, "Move Operation Completed.")

End Sub

In the above example, it pops up "OnEnd" and then moves the files before they are even transferred to the remote server thus causing the transfer to fail as it can't find the local files.

Thanks again for your help.
Last edited by JBC on Thu Sep 01, 2011 5:15 pm, edited 1 time in total.

Posts: 12031
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)

Re: Launch Script after Transfers Complete

Post by mb » Thu Sep 01, 2011 6:35 pm

Hello ..
The SDK is provided as is and support is not included in your license. Technical support is charged separably. Please contact the sales department for the conditions.