l4i
...
Box Connection
File Operations
Upload File
1 min
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)