Error getting tags :
error 404Error getting tags :
error 404 libURLftpUpload | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Expander triangle
libURLftpUpload value,uploadURL[,callbackMessage]
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Uploads data to an Internet server asynchronously via FTP.

libURLftpUpload field "Data",""
libURLftpUpload URL "binfile:data.jef",myURL,"uploadDone"
libURLftpUpload myData,""

Additional Comments
Expander triangle

Use the libURLftpUpload command to put a file on a server.


The value is any expression that evaluates to a string.

The uploadURL specifies the server and location to upload to, in the form of an ftp URL.

The callbackMessage is the name of a message to send after the URL is uploaded.


The libURLftpUpload command is non-blocking, so it does not stop the current handler while the upload is completed. The handler continues while the libURLftpUpload command uploads the URL in the background. You can monitor the upload by checking the URLStatus function periodically.

To upload a URL while blocking other operations, use the put command instead.

To upload a file, use the file URL type (for text files) or the binfile URL type (for binary files). Because referring to a file URL's contents loads the file into memory, if you are uploading a large file, make sure you have enough memory available. You can also use the libURLftpUploadFile command to upload a file.

The callbackMessage is sent to the object whose script contains the libURLftpUpload command, after the upload is complete, so you can handle the callbackMessage to perform any tasks you want to delay until the URL has been uploaded. Two parameters are sent with the message: the URL and the URLStatus of the file.

Caution! Avoid using the waitcommand in a handler after executing the libURLftpUploadcommand. Since the libURLftpUploadcommand is non-blocking, it may still be running when your handler reaches the waitcommand. And since the libURLftpUpload command is part of the Internet library and is implemented in a handler, the waitcommand will stop the upload process if it is executed while the download is still going on. In particular, do not use constructions like the following, which will sit forever without uploading the file:

libURLftpUpload field "Upload Data",myURL

wait until the URLStatus of myURL is "uploaded" -- DON'T DO THIS

The URLStatus function returns the status of the uploaded file. If you no longer need to monitor the file's status, use the unload command to remove it from the URLStatus function's listing.

Important! The libURLftpUploadcommand is part of the Internet library. To ensure that the command works in a standalone application, you must include this custom library when you create your standalone. In the Inclusions section of the Standalone Application Settings window, make sure "Internet Library" is selected in the list of script libraries.

Note: When included in a standalone application, the Internet library is implemented as a hidden group and made available when the group receives its first openBackground message. During the first part of the application's startup process, before this message is sent, the libURLftpUploadcommand is not yet available. This may affect attempts to use this command in startup, preOpenStack, openStack, or preOpenCardhandlers in the main stack. Once the application has finished starting up, the library is available and the libURLftpUploadcommand can be used in any handler.

User Comments
Expander triangle