Skip to main content
Skip table of contents

7.2 Uploading Files and Folders via basic protocol (deprecated)

File upload is implemented by a Thru server via HTTP POST command to a URL servername/upload.aspx that requires authentication via session ID. It is recommended to use HTTPS connection for security purposes.

Size of each uploaded file is limited to 2GB. To upload the files larger than 2GB please use extended upload protocol.

HTTP POST command is used to send the parameters and upload files as part of multipart forms of the following type:

<FORM ENCTYPE="multipart/form-data" action=" servername/upload.aspx " method=post>
<INPUT NAME="file" TYPE="file">
<INPUT NAME="filename0" TYPE="hidden" value=”filename.ext”>
<INPUT NAME="Description0" TYPE="hidden" value=”description_here”>
<INPUT NAME=" SessionID" TYPE="hidden" value=sessionID>
<INPUT NAME=" folderID " TYPE="hidden" value= folderID >
<INPUT NAME=" EntityCount " TYPE="hidden" value = 1>
<INPUT NAME=" overwrite" TYPE="hidden" value=[1 or 0 here]>
<INPUT NAME=" NoRedirect " TYPE="hidden" value=”any value here”>

File/Folder upload process can be implemented using .NET framework web client library or any other file upload library like COM objects from third-party vendors.

Upload via HTTP POST should be used in conjunction with web services to log into the server, browse to the target location and retrieve information on FileIDs and FolderIDs.

Web client library used by external application should issue HTTP POST command to the page servername/upload.aspx with the following set of fields:

·         ‘file’ contains file body. File size is limited to 2GB due to HTTP POST implementation by the browsers.

·         ‘filename0’ (ends with zero): name that will be given to the file in Thru server.

·         ‘Description0’ (ends with zero): name that will be given to the file in Thru server.

·         ‘SessionID’ should be set to current sessionID, returned by one of the Open() web service calls.

·         ‘folderID’ should be  set to id of the target parent folder where a file should be uploaded. The folderID has to be retrieved via prior calls to web services such as GetFolders or GetFolder.

·         “EntityCount” should be set to 1 since only one file is uploaded

·         “overwrite” flag equals 1 means that existing file with the same name in the same parent folder should be overwritten, if set to 0, the new file name will be versioned to name[i]

·         "NoRedirect" parameter has to be defined in the POST request and set to any value for web libraries that call Thru server 3rd party applications. Please note this is mandatory parameter for external applications.

The following values of HTTP headers are returned as result of upload:

In case of successful upload:

"X-FileID0" (ends with zero) contains File ID of newly created file in Thru server.

In case of error:

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

 

To upload multiple files external application should repeat the file uploading process specified in for each file

To upload the folder hierarchies to Thru server, external application should use connect to Thru server using one of Open() web service calls and use call CreateFolder() to create Thru folder. Each file should be uploaded according to the process specified in 2.6.2. There is no size limit on the folder upload except for 2GB upload per each file.

JavaScript errors detected

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

If this problem persists, please contact our support.