Copyright © 2005-2018 MultiMedia Soft

Downloader.SessionDataSizeGet method

Previous pageReturn to chapter overviewNext page

Remarks

 

Obtains the size in bytes of the remote file pointed by the given URL.

This method can be used to determine the size of the memory buffer needed to perform a memory-based downloading of a remote file through the Downloader.SessionStartToMemory method.

 

For details about management of download sessions from HTTP and FTP servers, refer to the How to manage download sessions tutorial.

 

 

Syntax

 

[Visual Basic]

Public Function SessionDataSizeGet (

strURL as String,

strUsername as String,

strPassword as String,

ByRef nDataSize as Int32,

ByRef nSdkError as Int32,

ByRef strExtendedErrorMsg as String

) as enumErrorCodes


 

[C#]

public enumErrorCodes SessionDataSizeGet (

string strURL,

string strUsername,

string strPassword,

ref Int32 nDataSize,

ref Int32 nSdkError,

ref string strExtendedErrorMsg

);


 

[C++]

public: enumErrorCodes SessionDataSizeGet(

string strURL,

string strUsername,

string strPassword,

Int32 __gc *nDataSize,

Int32 __gc *nSdkError,

string __gc *strExtendedErrorMsg

);


 

 

Parameter

Description

 

 

strURL

String containing the URL pointing to the remote media file to download. Accepted Internet protocols for the passed URL must be of type HTTP or FTP.

strUsername

String containing the username for accessing the server. Leave the string empty if the directory containing the remote file is not username protected.

strPassword

String containing the password for accessing the server. Leave the string empty if the directory containing the remote file is not password protected.

nDataSize

Reference that, on return from the method call, will contain the size in bytes of the remote file.

nSdkError

Reference that, on return from the method call, and in case of error will contain the eventual error code defined by the Windows SDK.

In case the error code should be ERROR_INTERNET_EXTENDED_ERROR (12003), this would mean that an extended error was returned from the server. This is typically a string or buffer containing a verbose error message; the string containing the message is provided back to the caller through the strExtendedErrorMsg parameter.

strExtendedErrorMsg

Reference that, on return from the method call with an error condition and with the value returned inside the nSdkError parameter set to ERROR_INTERNET_EXTENDED_ERROR (12003), will contain the string reporting the extended error message.

 

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred (see the LastError property for further error details).

In case of error the nSdkError and strExtendedErrorMsg parameters may contain further information about the nature of the error.

enumErrorCodes.NOERROR (0)

The method call was successful.