Файл
Въпросите от тип файл позволяват на респондентите да качват документи и други файлове като част от отговорите им.
The file question type allows respondents to upload any file from their device — documents, spreadsheets, PDFs, or other file types. Unlike image, audio, and video which launch specific capture tools, file opens a general-purpose file picker.
Basic XLSForm Specification
| type | name | label |
|---|---|---|
| file | document | Please upload your document |
For more details on the standard file question type, see the XLSForm specification.
Uses
File questions are commonly used for:
- Collecting supporting documents (receipts, certificates, contracts, reports)
- Uploading completed paper forms that were scanned
- Gathering spreadsheets or data exports from other systems
- Any digital file type that image/audio/video does not cover
Data format
Uploaded files are stored as binary attachments:
- Format: Preserved in original format (PDF, XLSX, DOCX, etc.)
- Naming:
{instanceID}-{fieldname}.{extension} - Storage: Uploaded to the server media folder alongside the submission
- Access: Downloadable from the submission management interface
rtSurvey extensions
Accepted file types
Use the parameters column to restrict which file types can be selected:
| type | name | label | parameters |
|---|---|---|---|
| file | report | Upload the inspection report | accept=.pdf |
| file | spreadsheet | Upload the data file | accept=.xlsx,.csv |
The accept parameter uses standard file extension syntax (comma-separated).
File size guidance
rtSurvey does not enforce a hard file-size limit at the question level, but the server upload limit applies. Use hint to communicate expectations to the enumerator:
| type | name | label | hint |
|---|---|---|---|
| file | receipt | Upload the payment receipt | Accepted: PDF or image. Maximum file size: 5 MB |
Integration with device file system and cloud storage
On Android and iOS, the file question opens the device’s native file picker, which may include access to:
- Local device storage
- SD card (Android)
- iCloud Drive (iOS)
- Google Drive, Dropbox (if installed)
On web, it opens the browser’s standard file upload dialog.
Example usage
Required PDF upload
| type | name | label | hint | required | required_message |
|---|---|---|---|---|---|
| file | signed_consent | Upload the signed consent form | PDF only, max 2MB | yes | A consent form is required |
Conditional document upload
| type | name | label | relevant |
|---|---|---|---|
| select_one yesno | has_land_title | Does the household have a land title? | |
| file | land_title_doc | Upload a photo or scan of the land title | ${has_land_title} = 'yes' |
Best Practices
- Use
acceptto restrict file types — this prevents enumerators from accidentally uploading wrong files. - Always include size and format guidance in the
hintcolumn. - For photos and images, use the
imagetype instead — it offers better compression and consistent format handling. - For large surveys with file attachments, plan your data storage and download bandwidth accordingly.
- Test the file picker on the target device type (Android vs. iOS vs. web) before deployment — access to cloud drives varies.
Data handling considerations
- Files are stored in their original format; they are not converted or compressed by rtSurvey.
- Analyse files after download — rtSurvey does not extract or index file contents.
- Large file attachments significantly increase the time required to download a full dataset.
Limitations
- File questions do not validate file contents — only the file extension check via
acceptis enforced at the UI level. - Very large files (100 MB+) may time out on upload in low-connectivity environments.
- Offline enumerators can attach files but they will not upload until connectivity is restored.
- Some device configurations restrict access to certain storage locations (e.g., corporate MDM policies).