Wiki source code of file_storage/upload_file.php

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

Show last authors
1 (% class="box" %)
2 (((
3 Table of Contents
4 )))
5
6 {{toc/}}
7
8 Upload a new file to file storage.
9
10 = Description =
11
12 (% class="blue mark" %)**POST**(%%)//**  /file_storage/upload_file.php?company**=RTI_COMPANYKEY**&import**=RTI_IMPORTKEY**&path**=PATH//
13
14 = Parameters =
15
16 == Query parameters ==
17
18 |=Parameter|=Description|=Type|=Note|=Mandatory
19 |company|RTI company key|string| |yes
20 |import|RTI import key|string| |yes
21 |path|target path|string|Format: folder/subfolder/.../target folder (separated by /)
22 Root does not have to be specified in path. Paths are case insensitive.
23 If not set, file will be uploaded to root.|no
24 |check_duplicates| |string|This 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.
25 Is true by default.|no
26
27 **Attention**: The max file size is 1.5 MB.
28
29 == Body parameters ==
30
31 |=Parameter|=Description|=Type|=Note|=Mandatory
32 |file|new file|file|The following file types are currently allowed:(((
33 * PNG
34 * JPG
35 * GIF
36 * MS Word
37 * MS Excel
38 * PDF
39 )))You can only upload one file per request. The maximum file size is 2 MB.|yes
40
41 = Return =
42
43 If there are errors in the configuration of parameters, you will receive  "(% class="error" %)**ERROR:description**(%%)". If the upload was started, you will receive the result as JSON.
44 **return example**
45 {{code language="java"}}[
46     {
47       "name": "file.png",
48       "status": "OK",
49       "uuid":"08910afd0bfcc7aa193d40c486ca156a"
50     }
51 ]{{/code}}
52
53 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.
54 You can use the UUID as reference for [[file_storage/modify_file.php>>doc:YellowFox Remote Tracking Interface.Funktionen.Dateiablage.file_storagemodify_file\.php.WebHome]] or to attach files via [[do_order>>doc:YellowFox Remote Tracking Interface.Funktionen.Aufträge und Nachrichten.do_order\.php.WebHome]] resp. [[do_message>>doc:YellowFox Remote Tracking Interface.Funktionen.Aufträge und Nachrichten.do_message\.php.WebHome]].
55