For information about Globalscape, visit www.globalscape.com. |
Use the Upload method to transfer a file or folder from a local hard drive to a remote server.
Syntax
Object.Upload(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. |
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")
'Specify user, pass, host, and connect as normal...
MySite.Connect 'r;Recommended: call connect first
MySite.RemoteFolder = "Temp"
MySite.LocalFolder = "C:\123"
'using relative path, all files in folder 123 are uploaded to the folder Temp off the current folder on the server.
MySite.Upload "*.*"
Configuration Notes
You can only use multi-part uploads with servers that support the COMB command. Currently, only GlobalSCAPE Secure FTP server supports the COMB command.
Setting the Multi-part upload attribute can greatly increase the transfer speed for larger files under certain conditions. For example, the site must support multiple concurrent connections from the same user and you must have significant bandwidth.
The Upload method is a synchronous command, meaning it must finish executing before subsequent commands in your script can be called. Use the method UploadAsync (which also supports Multi-part transfers) to synchronously upload files, which allows you to execute the rest of the script while the upload(s) take place.
You cannot upload and rename multiple files by specifying a wildcard in the strRemoteName parameter. For example, MySite.Upload "*.exe", "*.txt" will upload all of the files in the current local folder that end with *.exe to a remote folder named "_.txt". That is, if you specify a wildcard, the wildcard character is replaced by an underscore ( _ ) character.