Error getting tags :
error 404Error getting tags :
error 404 URLStatus | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
URLStatus
Basics
Expander triangle
Type
Function
Syntax
the URLStatus of url URLStatus(url)
Introduced
1.0
Changed
1.1.1
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
Network
Summary
Returns the status of uploads and downloads that were started with the load, libURLDownloadToFile, libURLftpUpload, and libURLftpUploadFilecommands.
Examples

the URLStatus of "http://www.example.com/test.html"
wait until URLStatus(field "URL") is "cached"
if URLStatus(myFile) is "error" then get libURLErrorData(myFile)

Additional Comments
Expander triangle

Use the URLStatus function to check the progress of an upload or download.

Parameters:

The url is a URL, or an expression that evaluates to a URL.

Value:

The URLStatus function returns one of the following values:

"queued": on hold until a previous request to the same site is completed

"contacted": the site has been contacted but no data has been sent or received yet

"requested": the URL has been requested

"loading,bytesReceived,bytesTotal": the URL data is being received

"uploading,bytesReceived,bytesTotal": the file is being uploaded to the URL

"cached": the URL is in the cache and the download is complete

"uploaded": the application has finished uploading the file to the URL

"error": an error occurred and the URL was not transferred

"timeout": the application timed out when attempting to transfer the URL

empty: the URL was not loaded, or has been unloaded

Comments:

You can check the cachedURLs function to determine whether a URL has already been downloaded. The URL is not placed in the cachedURLs until the download is complete, however, so you must use the URLStatus function to check a pending download or one that has been started but not finished.

Tip: To update a progress indicator or perform other tasks during uploads and downloads, use the libURLSetStatusCallbackcommand to automatically send a callback message every time the URLStatusfunction is updated. You can then write a handler for this message that performs whatever tasks are needed.

The third item (bytesTotal) in the "loading" or "uploading" status report is empty if it is not possible to determine the total file size. (For example, if an FTP server does not support the SIZE command, it's not possible to determine the file size when downloading a file from that server.)

If an error occurs during downloading, the URLStatus function returns "error". You can get the error message using the libURLErrorData function.

Important! The URLStatusfunction is part of the Internet library. To ensure that the function 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.

Changes to Revolution:

The URLStatus function became part of the Internet library in version 1.1. In previous versions, it was not a library function.

The queued, uploading, and uploaded values were introduced in version 1.1.1. In previous versions, file transfers to the same host were not queued, and the URLStatus function could not be used to check the progress of uploads.

User Comments
Expander triangle