Extended File Transfer Sample

Purpose

Some time ago we received several questions in our newsgroup asking how to download big files using the RemObjects SDK. This sample presents a working solution.

How it works

The approach is quite simple,instead of downloading a complete file at once, it is split into small chunks to be downloaded separately. On the client side, these are then combined back into a single file.

This  sample provides a RemObject server that exposes the content of a folder (see the  GetFilesList method in the ExtendedFileTransferService implementation) and a client that can connect to the server to obtain a list of the files available for downloading. The server also provides another method for downloading a chunk of a file called DownloadFilePart. This method requires three parameters:

DownloadFilePart reads the section of the file with offset PartSize*PartNo and returns the data as a Binary stream to the client. When we want to download a  file we can specify size of chunk (Below the Chunk Size combobox you will see calculated total count of chunks). Also we can specify the number of threads we want to use for the downloading operation. Since each partial chunk download is independent, using threads is quite attractive in this scenario.

Examine the code

Getting started