field.media-file

Adds buttons for different types of uploads: uploading photos or videos, selecting files from the file manager or choosing from the gallery. In the accept property, select which buttons you need.

By default, only one file can be uploaded, but you can allow multiple files in the multiple property.

This component is convenient when using mobile devices. To upload files from a computer, it's better to use field.file for a more flexible configuration of the file types.

In the task review mode, the uploaded images will appear automatically. You can view, rotate, and switch among the images.

View example

Using the Toloka mobile app

In the Toloka mobile app, the photo and video buttons open the camera, and the gallery and file manager buttons open the corresponding apps.

After a Toloker submits the task, the files are saved in the app and gradually uploaded to Toloka when there's a Wi-Fi connection. While there's no connection, the task status remains "Submitting via Wi-Fi".

Component properties

NameTypeDescription
type*"field.media-file"Set component type.
data*writable

Data with values that will be processed or changed. Learn more about working with data.

labelstringLabel above the component.
accept*objectAdds different buttons for four types of uploads. Pass the true value for the ones that you need.

For example, if you need a button for uploading files from the gallery, add the "gallery": true property.
accept.fileSystembooleanAdds a button for uploading files from the file manager.
accept.gallerybooleanAdds a button for uploading files from the gallery.
accept.photobooleanAdds a button for uploading images.
accept.videobooleanAdds a button for uploading videos.
hintstringHint text.
multipleboolean

Determines whether multiple files can be uploaded:

  • false (default) — forbidden.
  • true — allowed.
requiredCoordinatesbooleanIf the value is true, a file without geotag can not be uploaded.
validationconditionValidation based on condition.
Contact support

Last updated: May 26, 2023

Introduction
Getting started
Important tips
Useful recommendations
Working with Toloka
Projects
Pools
Tasks
Results
Project analysis
Toloka settings
Task interface
Template Builder
HTML/CSS/JS editor
Help and support
FAQTroubleshootingSupportGlossary