file_storage/upload_file.php

Last modified by YellowFox_RD on 2025/01/23 09:46

Table of Contents

Upload a new file to file storage.

Description

POST   /file_storage/upload_file.php?company=RTI_COMPANYKEY&import=RTI_IMPORTKEY&path=PATH

Parameters

Query parameters

ParameterDescriptionTypeNoteMandatory
companyRTI company keystring yes
importRTI import keystring yes
pathtarget pathstringFormat: folder/subfolder/.../target folder (separated by /)
Root does not have to be specified in path. Paths are case insensitive.
If not set, file will be uploaded to root.
no
check_duplicates stringThis flag marks if a duplicate check should be done before uploading. Can be set to true or false. If activated and a duplicate was recognized, you will receive 'File recognized as duplicate' as the status (see return value). The file will not be uploaded again, but you will receive the uuid of the already existing duplicate in your file storage. This function always checks for duplicates in the whole storage, not just the set path.
Is true by default.
no

Attention: The max file size is 1.5 MB.

Body parameters

ParameterDescriptionTypeNoteMandatory
filenew filefileThe following file types are currently allowed:
  • PNG
  • JPG
  • GIF
  • MS Word
  • MS Excel
  • PDF
You can only upload one file per request. The maximum file size is 2 MB.
yes

Return

If there are errors in the configuration of parameters, you will receive  "ERROR:description". If the upload was started, you will receive the result as JSON.
return example
[
    {
      "name": "file.png",
      "status": "OK",
      "uuid":"08910afd0bfcc7aa193d40c486ca156a"
    }
]

On successful upload you will receive the status "OK" and the UUID for the new file. On error you will get the corresponding error message and the UUID will be empty.
You can use the UUID as reference for file_storage/modify_file.php or to attach files via do_order resp. do_message.