SocketTools .NET Edition

WebStorage.GetFile Method 

Download the data in a stored object to a local file.

[Visual Basic]
Public Function GetFile( _
   ByVal localFile As String, _
   ByVal labelName As String _
) As Boolean
[C#]
public bool GetFile(
   string localFile,
   string labelName
);

Parameters

localFile
A string which specifies the name of the local file that will be created or overwritten with the contents of the storage object. If a path is not specified, the file will be created in the current working directory.
labelName
A string which specifies the label of the object that should be retrieved from the server.

Return Value

This method returns a boolean value. If the object exists and could be retrieved from the server, this method will return true, otherwise it will return false.

Remarks

The GetFile method downloads data from a stored object to a local file. This method will cause the current thread to block until the data transfer completes, a timeout occurs or the transfer is canceled. During the transfer, the OnProgress event will fire periodically, enabling the application to update any user interface objects such as a progress bar.

When this method returns, various properties that contain information about the current object, such as ObjectId and ObjectSize, will be updated to return the metadata associated with the object which was downloaded.

See Also