l4i
...
Box Connection
File Operations
Upload File
1min
This method will Upload a File to Box and optionally set an Enterprise Metadata Template and Metadata Values.
Input Parameters:
- Folder ID: ID of the folder to create the file in (required). NOTE: ensure the connection being used has permissions to the folder specified
- File Name: The name to be used for the file. This will appear in the 'Name' column in Box. NOTE: Box determines the file type based on the extesion used with the File Name
- Conflict Behaviour: If a file with the same name already exists in the folder, this setting determines how TRex should handle reconciling this
- Use Existing: Keep the existing file and continue normal processing (no error surfaced)
- Use Existing - Overwrite Metadata: Keep the existing file but update any Metadata values (if provided)
- Append Unique ID: This will append a uniquely generated ID string to the filename
- Replace: This will delete the existing file and replace it with the file being uploaded
- Version: This will version the existing file
- Fail: The upload will fail and the Box error will be returned
- File Content: Reference to the Binary File Object
Setting Metadata Values:
NOTE: TRex only supports setting a single Enterprise Metadata Template and values during creation. To add additional metadata templates and values to the document, use the 'Update File' method after the 'Upload File' method.
- Metadata Values: These are the values for either Enterprise Metadata (defined in a metadata template) or Global Metadata (string value pairs directly attributed to a document)
- Click on the pencil icon in the top right to edit the definition of metadata
- Drag an 'Available Parameter' from the Available Parameters to the middle section called 'Defined Parameters'
- There are three types of Parameters
- Description: This allows the setting of the description on the document. No additional configuration/naming is required. The name should be left as 'Description' and the datatype left as 'String'
- Enterprise Metadata Value: This allows setting of Enterprise Metadata that is defined on a pre-defined Metadata Template.
- Name: This is required to be the name of the metadata value defined in Box. It will include the Metadata Template name that it is assoicated with. (e.g. trexMetadata.trexTextField)
- Data Type: The type value assigned in the Box metadata definition
- Global Metadata Value: This allows the setting of key/value pair strings to be added to a document
- Name: This should match the metadata value of a Custom Attribute already defined on the document. it will always be prefixed with the value 'document' followed by the name of the box value (e.g. document.trexMyCustomString)