Button for image file upload
Note
The task interface configuration guide describes the features of the HTML/JS/CSS editor. You can also try creating a button for uploading images in Template Builder.
To add an image upload button {{field type= "file-img" name="<output field name> "sources="<sources parameter>" fileType="<fileType parameter>"}}
. After the image is uploaded the Toloker will see an icon for image preview. Example:
{{field type="file-img" name="photo" sources="CAMERA" fileType="IMAGE" camera=true}}
In the output data description, add one of the fields:
-
Field with the
file
type — for uploading one image only. Example:{ "result": { "type": "file", "required": true } }
-
Field with the
array_file
type — for uploading several images at once. Example:{ "result": { "type": "array_file", "required": true } }
Parameters
Parameter |
Description |
Required |
Default value |
|
Field type: |
yes |
no |
|
Attribute for the output data field. Contains the output field name. |
yes |
no |
|
Note This parameter applies to the tasks completed in the mobile app. The file source. You can specify multiple values in the Supported values:
|
Yes (when creating tasks for mobile devices) |
no |
|
Note This parameter applies to the tasks completed in the mobile app. File type: |
Yes (when creating tasks for mobile devices) |
no |
|
The position of popup hints (displayed if the response didn't pass validation). The position is relative to the input field. Supported values:
|
no |
|
|
Displaying an image preview after image file upload:
|
no |
|
|
Open the camera when the image upload button is clicked:
|
no |
|
|
Image compression:
|
no |
|
|
Whether coordinates should be required in the image data.
|
no |
|
|
The number of files to download at the same time. For the single file upload, set the value to For upload of multiple files:
|
no |
|