Skip to main content
To upload a new version of a file to Box via direct upload, make an API call to the API with the content of the file, the desired file name, and the folder ID.
Run a before you upload. The check confirms that Box accepts the file before you send it.

Request format

The request body of this API uses a content type of multipart/form-data. The body sends two parts: the file attributes and the file content. The first part is called attributes and contains a JSON object with information about the file, including the name of the file and the id of the parent folder. The following example uploads test.txt to the user’s root folder.
The attributes JSON part of the multipart body must come before the file part of the multipart form data. When out of order, the API returns an HTTP 400 status code with an error code of metadata_after_file_contents.

Options

For the parameters available when uploading files, see the . These parameters include content-md5, which you can set so Box can detect corruption in transit, and a way to set the file creation time separately from the upload time. For file versions, pass an additional to prevent overwriting a file that was updated since you last inspected the content.

Restrictions

Direct uploads are limited to a maximum file size of 50 MB. For larger files, use the . To upload a new version of a large file with a Box SDK, use the , which skips the parts Box already stores from the previous version. Upload limits depend on the authenticated user’s account type. See the .
Last modified on November 12, 2026