DataJet
Search…
multipart
Lets consider following code for HTTP task:
1
{% json upload_options %}
2
{
3
"fileName": "user_provided_photo.png",
4
"multipart": {{request.files.["user-file"] | default: "" | json }},
5
"public": false
6
}
7
{% endjson %}
8
9
{% assign file_result = upload_options | file %}
10
11
{% json ftp_params %}
12
{
13
"mode": "upload",
14
"host": "datajet-app.com",
15
"user": "[email protected]"",
16
"password": "pass123",
17
"file": {{file_result.fileName | json }},
18
"fileName": "ftp_file.png",
19
"path": "/",
20
"port": 21
21
}
22
{% endjson %}
23
{% assign ftp_result = ftp_params | ftp %}
Copied!
In above code we define some upload_options. Parameters are:
  • fileName - under this name your file will be saved in the storage
  • multipart - this parameter tells that the expected file source is multipart. For files with url source it would be replaced with url and for content files with content.
  • public - optional parameter. When set to true your result object will contain an url to your file. With this url everyone can access your upload.
Our file_result will contain fileName parameter (if upload is successful). This is next used in ftp filter options to specify file in your storage and upload it to an FTP.
Last modified 9mo ago
Copy link