Manage Applications

    Preflight check

    options
    https://api.box.com/2.0
    /files/content

    Performs a check to verify that a file will be accepted by Box before you upload the entire file.

    Request

    application/json

    Request Body

    stringin bodyoptional
    File.mp4

    The name for the file

    Parentin body

    The parent folder to upload the file to

    stringin bodyoptional
    123

    The ID of parent item

    integer / int32in bodyoptional
    1024

    The size of the file in bytes

    Response

    application/jsonUpload Url

    If the check passed, the response will include a session URL that can be used to upload the file to.

    application/jsonConflict Error

    If the check did not pass, the response will include some details on why it did not pass.

    You can now try out some of our APIs live, right here in the documentation.
    Log In

    Request Example

    cURL
    curl -X OPTIONS https://api.box.com/2.0/files/content \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Content-Type: application/json"
    Java
    String fileName = "My Doc.pdf";
    BoxFolder rootFolder = BoxFolder.getRootFolder(api);
    try {
        folder.canUpload(fileName, 98734576);
    
        // If the file upload would not have succeeded, it will not be attempted
        folder.uploadFile(fileContents, fileName);
    } catch (BoxAPIException ex) (
    
    )
    Node
    // Verify that uploading a 200MB file named "Preso.ppt" to folder 12345 would succeed
    client.files.preflightUploadFile(
    		'12345',
    		{
    			name: 'Preso.ppt',
    			size: 200000000
    		},
    		null,
    		callback
    	);

    Response Example

    {
      "upload_url": "https://upload-las.app.box.com/api/2.0/files/content?upload_session_id=1234",
      "upload_token": "Pc3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQP"
    }