Uploading Items Asynchronously (UploadAsync)

Use the UploadAsync method to upload a file or folder to a remote server asynchronously. An asynchronous upload starts and then returns control to the script before the transfer finishes. This allows you to perform many simultaneous transfers because the method does not wait for the upload to end.

Immediately after you call this method subsequent methods in your script will be called, so be careful when timing certain events.

If UploadAsync encounters a problem when trying to complete its task, it will not throw a COM, ATL, or VB error. UploadAsync will also adhere to your max global and per site settings.

Syntax

Object.UploadAsync(BSTR strLocalName [,BSTR strRemoteName [, long nMultiPartNumber]])

Parameters

strRemoteName

This is optional, use it only if you want to change the destination name or path for the uploaded files or folders. You can use absolute or relative paths with or without wildcards.

strLocalName

This is the path to the local item you are uploading. You can use absolute or relative paths with or without wildcards.

nMultiPartNumber

Use this to split the upload into multiple parts. The default value = 1. The value specifies the number of parts used for the download.

Example

Set MySite = CreateObject("CuteFTPPro.TEConnection")

'Initialize all necessary fields for MySite : host name, user, password, etc.

MySite.Connect

MySite.UploadAsync "c:\temp\*.vob", "/DVDFiles" 'uploads as many .vob files as concurrent connection settings allow

 

The multi-part parameter for the UploadAysnc is currently limited to servers that support this operation, due to the need to recombine the files after the upload of each part has completed. GlobalSCAPE's Secure Server and EFT Server support this function.