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:
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 File System Service. There is no size limit on the folder upload except for 2GB upload per each file.