TRY NEW VERSION

POST api/2.0/files/@my/upload This function requires authentication

Description

Uploads a file specified in the request to the "My documents" section by single file uploading or standart multipart/form-data method.

Parameters
Name Description Type Example
File
sent in body
File Microsoft.AspNetCore.Http.IFormFile
ContentType
sent in body
Content-Type header A content type for stream when uploading files without multipart request application/octet-stream
Set Content-Type header
ContentDisposition
sent in body
Content-Disposition header A Content Disposition with file name for stream when uploading files without multipart request attachment; filename="file1.png"
Set Content-Disposition header
Files
sent in body
List of files when specified as multipart/form-data Collection of Microsoft.AspNetCore.Http.IFormFiles
collection
CreateNewIfExist
sent in body
Specifies whether to create a new file if it already exists or not Bool value true
StoreOriginalFileFlag
sent in body
Specifies whether to upload documents in the original formats as well or not Bool value true
KeepConvertStatus
sent in body
Specifies whether to keep the file converting status or not Bool value true
Stream
sent in body
Request input stream A stream for uploading files without multipart request N/A
Remark

You can upload files in two different ways:

  1. Using single file upload. You should set the Content-Type and Content-Disposition headers to specify a file name and content type, and send the file to the request body.
  2. Using standart multipart/form-data method.

Example
POST api/2.0/files/@my/upload
Host: yourportal.onlyoffice.com
Content-Type: application/json
Accept: application/json

{
  "CreateNewIfExist": true,
  "StoreOriginalFileFlag": true,
  "KeepConvertStatus": true,
  "Stream": "N/A"
}
Returns

Uploaded file(s)