Drive > Files > File/Directory > Upload

Cancel by path

Cancel an upload by its path (for instance, if the session token is unknown)

delete/2/drive/{drive_id}/upload

Path parameters

drive_idinteger required

Drive identifier

Request body

directory_idinteger

The directory destination root of the new file. Must be a directory. <note>If the identifier is unknown you can use only <strong>directory_path</strong>.</note> <note>The identifier <strong>1</strong> is the user root folder.</note> <note>Required without <strong>directory_path</strong></note>

directory_pathstring nullable

The destination path of the new file. If the <strong> directory_id</strong> is provided the directory path is used as a relative path, otherwise it will be used as an absolute path. The destination should be a directory. <note>If the directory path does not exist, folders are created automatically.</note> <note>The path is a destination path, the file name should not be provided at the end.</note> <note>Required without <strong>directory_id</strong>.</note>

file_idinteger

File identifier of uploaded file. <note>This is an alternative to replace a file by its identifier, if this mode is used <strong>file_name</strong>, <strong>directory_id</strong>, <strong>conflict</strong> and <strong>directory_path</strong> params are automatically computed and cannot be provided.</note> <note>If you don't know the identifier, or you want to upload a new file, you should provide a filename and a directory destination.</note>

file_namestring

The name of the file to create. <note>Slashes will be replaced by colons.</note> <note>Maximum bytes size is 255</note>

Example request

{
  "directory_path": "/Directory/SubDirectory",
  "file_name": "file.txt"
}

Response

OK

result'success' | 'error' | 'asynchronous' required

Result of the HTTP request

databoolean

Example response

{
  "result": "success"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.