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

typenamelabel
filedocumentPlease upload your document

For more details on the standard file question type, see the XLSForm specification.

Uses

File questions are commonly used for:

  1. Collecting supporting documents (receipts, certificates, contracts, reports)
  2. Uploading completed paper forms that were scanned
  3. Gathering spreadsheets or data exports from other systems
  4. 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:

typenamelabelparameters
filereportUpload the inspection reportaccept=.pdf
filespreadsheetUpload the data fileaccept=.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:

typenamelabelhint
filereceiptUpload the payment receiptAccepted: 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

typenamelabelhintrequiredrequired_message
filesigned_consentUpload the signed consent formPDF only, max 2MByesA consent form is required

Conditional document upload

typenamelabelrelevant
select_one yesnohas_land_titleDoes the household have a land title?
fileland_title_docUpload a photo or scan of the land title${has_land_title} = 'yes'

Best Practices

  1. Use accept to restrict file types — this prevents enumerators from accidentally uploading wrong files.
  2. Always include size and format guidance in the hint column.
  3. For photos and images, use the image type instead — it offers better compression and consistent format handling.
  4. For large surveys with file attachments, plan your data storage and download bandwidth accordingly.
  5. 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 accept is 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).
Беше ли полезна тази страница?