API Reference
Log In
API Reference

Upload file

After getting the upload link, POST to this link for uploading files.
The request body must be in multipart/form-data format.
Upon successful upload, this API returns information about uploaded files in the response body.

  • If ret-json parameter is set to 1, the returned information is encoded in JSON. For each uploaded file, a JSON object containing "name", "id", "size" fields will be returned.
  • If ret-json parameter is set to 0, the returned information is a tab separated list of file IDs.
Path Params
string
required
Query Params
string

returns a json array including file info if set to 1. If this parameter is not set, the file ids will be returned in a tab-separated string. New apps should set ret-json to 1.

Body Params
file

this field contains the contents to be uploaded.

string

path in your Seafile repo that you want to upload local file to. This path must be the same as the 'p' parameter you specified when getting the upload link.

string

sub-folder of "parent_dir", if this sub-folder does not exist, Seafile will create it recursively. When you upload a folder, you should set this parameter to the uploaded folder's name.

string

whether to overwrite file when it already exists. 1 for replace, 0 for not replace. If existing file is not replaced, the uploaded file will be renamed to the form "filename (1).txt".

string

the last modified time of the file when uploaded.

Response

Language
Credentials
URL
Click Try It! to start a request and see the response here! Or choose an example:
application/json