FileDownload Service API
Introduction

The FileDownload service is used by webAppOS and some apps to download files to the server.

Access URL

The FileDownload service is accessible via the following URL:

http[s]://[domain_or_ip]/services/filedownload/[login]/[relative/path/to/file/being/downloaded]

Use the HTTP GET method to download files.

Authentication

All requests require webAppOS authentication.  The auth info must be sent in the URL query string (URL encoded) by specifying the "login" and "ws_token" arguments.

Example
http[s]://[domain_or_ip]/services/filedownload/[login]/[some/relative/path/to/file]?login=[your-login]&ws_token=[your-ws_token]
Methods
Download a file from the user's home directory
GET http[s]://[domain_or_ip]/services/filedownload/[login]/[relative-path-to-a-file]?login=[your-login]&ws_token=[your-ws_token]
Returns

an octet stream contatining the given file (content type will be "application/octet-stream").

On error, returns a JSON:

{
"error": "{message}"
}
Download a file from the project
GET http[s]://[domain_or_ip]/services/filedownload/[project_id]/[path-to-a-file-within-a-project]?login=[your-login]&ws_token=[your-ws_token]&project_id=[project_id]

An additional no-value query parameter "auto_content_type" can be specified to instruct the service to guess the content type.

Returns

an octet stream contatining the given file (content type will be "application/octet-stream", unless the "auto_content_type" parameter was specified).

On error, returns a JSON:

{
"error": "{message}"
}