---
title: "Cancel by path"
method: DELETE
path: "/2/drive/{drive_id}/upload"
tags: ["Drive > Files > File/Directory > Upload"]
---

# Cancel by path

`DELETE /2/drive/{drive_id}/upload`

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

## Path parameters

- `drive_id` integer, required

## Request body

- object
  - `directory_id` integer — 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_path` string, 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_id` integer — 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_name` string — The name of the file to create. <note>Slashes will be replaced by colons.</note> <note>Maximum bytes size is 255</note>

## Response `200`

OK

- object
  - `result` 'success' | 'error' | 'asynchronous', required — Result of the HTTP request
  - `data` boolean

## Other responses

- `403` — Forbidden
- `503` — Service Unavailable

---

[API](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools.md) · [All operations](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/infomaniak/api-reference-developer-tools/revisions/667aae28fec6/schema)
