Skip to main content
Skip table of contents

2.6.1 Downloading

File and folder downloads from Thru server should be implemented via HTTP GET to a URL servername/download.aspx, the URL requires authentication via SessionID for existing user session.

External application that connects to a Thru server should browse to a Thru folder that contains required files using web services. Once in the right folder, Web call GetFiles returns an array of FTHFileData objects, each object contains FileID for the files stored in requested parent folder. WS call GetFolders returns an array of FTHFolderData objects, each object contains FolderID for the folders stored in requested parent folder

  • Single File download: using HTTP library such as web client library included into .NET framework, external application issue the HTTP GET command to the URL servername/download.aspx?fileid=FileID&sessionid=SessionID , where FileID is retrieved by previous GetFiles WS call and SessionID parameter is returned by one of the Open() web service calls.
    In response Thru server starts writing selected file as a binary stream into HTTP client, the stream has to be saved into the local file system.
    It is highly recommended to open HTTPS connection to provide secure download.

  • Single Folder Download: using HTTP library such as web client library included into .NET framework, external application issues the HTTP GET command to the URL servername/download.aspx?folderid=FolderID&sessionid=SessionID, where FolderID is retrieved by previous GetFolders web call and SessionID parameter is returned by one of the Open() web service calls.

In response Thru server creates an archive in a ZIP format that includes all subfolders of a selected folder and starts writing an archive file as a binary stream into HTTP client. The stream has to be saved into the local file. Archive file is named following the pattern foldername.zip.

When external application has to download a folder, it is generally recommended to navigate down Thru folder tree and download files separately for better control at the file level, as opposed to downloading the whole folder that comes in a zipped form and has to be unzipped by a client application.

  • Downloading of multiple files and folders: using HTTP library such as web client library included into .NET framework, external application issue the HTTP GET command to the URL servername/download.aspx?fileid=FileID1, …FileDN& folderid=FolderID1, …FolderDN&sessionid=SessionID , where FileID1, …FileIDN is a comma-separated list of File IDs returned by a previous call to GetFiles and FolderD1, …FolderDN is a comma separated list of folder IDs returned by a previous call to GetFolders.
    SessionID parameter is returned by one of the Open() web service calls.

In response Thru server packages requested files and folders into ZIP archive named using the pattern “THRU-XXXXXXXXXX.zip” where XXX represents random combination of hexadecimal letters and digits, and starts writing the ZIP archive as a binary stream into HTTP client. The stream has to be saved into the local file system.

It is highly recommended to open HTTPS connection to provide secure download.

The following values of HTTP headers are returned in all cases:

o Content-Type “application/binary”
o Content-Disposition: attachment; filename=filename.ext (to save the file under original name)
o Content-Length:

In case of error the following custom HTTP header is returned that contains an error code and message:

o “X-FTH-Error”, error contents is ErrorCode and Error Message separated by pipe character: “ErrorCode | ErrorMessage”

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.