# File upload overview

Uploading files refers to uploading various files from the local environment to the cloud space. This document describes how to use interfaces to upload files.

## Restrictions
- The cloud space as a whole has a capacity limit as shown below:
	- If you upload files to the application cloud space through the application identity: the capacity of this cloud space is determined by the overall capacity of the tenant. Different enterprise versions correspond to different cloud space storage space, for details, refer to [Storage, importing, and Trash limits FAQs](https://www.feishu.cn/hc/en-US/articles/610104039880-storage-importing-and-trash-limits-faqs).
	- If uploading files to the user's cloud space: the user's cloud space capacity is controlled by the tenant's corporate administrator.

- The total number of nodes across all levels in the cloud space is capped at 400,000.

- The maximum number of single-layer nodes in the root directory or folders in the cloud space is 1500. Exceeding this limit, the interface will return error code 1062507. This can be resolved by creating files in different folders.
- File upload-related interfaces do not support concurrent calls, and the call frequency limit is 5 QPS, 10,000 times/day. Otherwise, error code 1061045 will be returned, which can be resolved by retrying later.

## Related APIs

Feishu's Open Platform provides several file upload interfaces. You need to choose the appropriate method based on the file size:
- If the current network connection is stable and the file size does not exceed 20 MB, directly call the [Upload File](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_all) interface to upload;
- If the current network connection is unstable, or the file size exceeds 20 MB, you should sequentially call the following multipart file upload interfaces to upload the file in fixed-length chunks, reducing the usage of bandwidth per instance and increasing the success rate of uploads. This upload method supports developers to display the overall file upload progress based on the chunk upload progress and supports resuming uploads within a day.

1. [Upload a file in blocks-Pre­uploading](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_prepare)

Send an initialization request to obtain the upload transaction ID and chunking strategy, preparing for the upload of chunks. The platform fixes the file chunk size to 4MB.

2. [Upload a file in blocks-Uploading](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_part)

Upload the corresponding file chunks according to the upload transaction ID and chunking strategy returned by the pre-upload interface.
    3. [Upload a file in blocks-Completing](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/upload_finish)

After all chunks have been uploaded using the upload part interface, you must call this interface to trigger the completion of the upload. Otherwise, the upload will fail.
