Update a file's content. For file sizes over 50MB we recommend using the Chunk Upload APIs.
The attributes
part of the body must come before the
file
part. Requests that do not follow this format when
uploading the file will receive a HTTP 400
error with a
metadata_after_file_contents
error code.
This operation is performed by calling function uploadFileVersion
.
See the endpoint docs at API Reference.
client.getUploads().uploadFileVersion(uploadedFile.getId(), new UploadFileVersionRequestBody(new UploadFileVersionRequestBodyAttributesField(newFileVersionName), newFileContentStream))
- fileId
String
- The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL
https://*.app.box.com/files/123
thefile_id
is123
. Example: "12345"
- The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL
- requestBody
UploadFileVersionRequestBody
- Request body of uploadFileVersion method
- queryParams
UploadFileVersionQueryParams
- Query parameters of uploadFileVersion method
- headers
UploadFileVersionHeaders
- Headers of uploadFileVersion method
This function returns a value of type Files
.
Returns the new file object in a list.
Performs a check to verify that a file will be accepted by Box before you upload the entire file.
This operation is performed by calling function preflightFileUploadCheck
.
See the endpoint docs at API Reference.
client.getUploads().preflightFileUploadCheck(new PreflightFileUploadCheckRequestBody.PreflightFileUploadCheckRequestBodyBuilder().name(newFileName).size(1024 * 1024).parent(new PreflightFileUploadCheckRequestBodyParentField.PreflightFileUploadCheckRequestBodyParentFieldBuilder().id("0").build()).build())
- requestBody
PreflightFileUploadCheckRequestBody
- Request body of preflightFileUploadCheck method
- headers
PreflightFileUploadCheckHeaders
- Headers of preflightFileUploadCheck method
This function returns a value of type UploadUrl
.
If the check passed, the response will include a session URL that can be used to upload the file to.
Uploads a small file to Box. For file sizes over 50MB we recommend using the Chunk Upload APIs.
The attributes
part of the body must come before the
file
part. Requests that do not follow this format when
uploading the file will receive a HTTP 400
error with a
metadata_after_file_contents
error code.
This operation is performed by calling function uploadFile
.
See the endpoint docs at API Reference.
client.getUploads().uploadFile(new UploadFileRequestBody(new UploadFileRequestBodyAttributesField(newFileName, new UploadFileRequestBodyAttributesParentField("0")), fileContentStream))
- requestBody
UploadFileRequestBody
- Request body of uploadFile method
- queryParams
UploadFileQueryParams
- Query parameters of uploadFile method
- headers
UploadFileHeaders
- Headers of uploadFile method
This function returns a value of type Files
.
Returns the new file object in a list.