Copyright © 2006-2023 MultiMedia Soft

How to manage download sessions

Previous pageReturn to chapter overviewNext page

Downloading tasks can be achieved through the Downloader COM object accessible through the Downloader property.

 

The Downloader COM object, which is intended for download of remote files only (so downloading from broadcasting streaming servers or radio stations is not supported), can be instanced and started through the Downloader.Create method and exposes the following features:

 

downloading a remote file and storing its contents inside a local file through the Downloader.SessionStartToFile method.

 

downloading a remote file and storing its contents inside a local memory buffer through the Downloader.SessionStartToMemory method: the size of the buffer, whose allocation is responsibility of the container application, can be determined through the Downloader.SessionDataSizeGet method.

 

 

All of the mentioned methods allow starting the downloading session and, in case of success, a session's unique identifier is returned: through this identifier you have the possibility to interrupt the same downloading session through the Downloader.SessionStop method.

 

A set of events is provided for keeping the container application up to date respect to the downloading session advancement:

 

- the DownloaderSessionStarted event reports that the downloading session is started

- the DownloaderSessionProgress event informs about the download advancement expressed in percentage

- the DownloaderSessionCompleted event reports that the downloading session is completed successfully

- the DownloaderSessionFailed event reports that the connection to the remote server or the access to the remote file failed

- the DownloaderSessionStopped event reports that the downloading session has been stopped by the user manually through a call to the Downloader.SessionStop method

 

When invoking the Downloader.Create method you can specify timeouts checked during the connection to the remote server and during data downloading: these timeouts can be modified at any time through the Downloader.SetTimeouts method.

 

 

A sample of usage the downloader in Visual Basic 6 can be found inside the following sample installed with the product's setup package:

- Downloader