
How to Attach Photos and Videos in QField
What you'll learn
- How to set up attachment attributes in QGIS
- Steps for linking files such as photos, videos, and audio to features in QField
- Tips for using attachments to make field surveys more efficient
Recommended for
- Anyone struggling to organize the photos and notes they take during field surveys
- Anyone who wants to get more out of QField's useful features
- Anyone who wants to move from paper field notebooks to digital data collection
Introduction
During a field survey, you often need to photograph the site as well as enter what you find into attributes. QField makes it easy to attach photos, videos, audio, and other files to features. This greatly improves the efficiency of data collection and management.

This article shows how to attach photos and other files to features in QField, along with tips for using attachments more efficiently.
How to create an attachment attribute in QGIS
To use this feature in QField, you first need to set up a file attachment attribute on the target layer in QGIS.
Open the QGIS project and add a text attribute (media in this example). Then open the properties of the target layer and select the attribute on the Attributes Form tab. For Widget Type, select Attachment.

Once this is set, the attribute form shows a ... button for the target attribute when you edit a feature. Use it to choose a file to attach.

For more details on configuring attribute forms, see the following article.
Attach files to attribute values in QField
Attach a file to a feature in QField
Next, check how the attribute looks in the QField app. Save the QGIS project and transfer it to your mobile device.
For details on transferring projects, see the following article.
After the transfer, open the project in QField. In edit mode, tap a feature to see the attribute ready for an attachment.

Tap the file icon to choose a file on the mobile device and attach it to the feature.

For example, when you select a photo, the image appears in the attribute panel.

You can also tap the ... button to the right of the attribute to show media attachment options for taking photos, recording video, and recording audio. This lets you link files in many formats directly to a feature.

Supported file types
This section introduces the types of media you can attach in QField.
Photo files
You can attach images already saved on the device, or take a photo on site and attach it directly.

Tap the curved-line icon at the top right of the cell to add a sketch directly on the image. This is handy for marking up a photo with annotations such as arrows and circles.

Video files
Attaching a video to a feature lets you record the surroundings in detail and view the subject from various angles.

Audio files
You can attach an audio file to a feature or record audio directly on site. This is especially useful for capturing ambient sounds, or for recording detailed observations by voice when typing is difficult.

Hand-drawn sketches
QField has a hand-drawn sketch feature. It is useful when you want to illustrate site conditions or complex layouts that are hard to explain with photos or text alone.

Document files
Besides multimedia files, you can attach document files such as PDFs. This lets you link materials such as analysis reports and specifications directly to your data.

Check attachments in QGIS
Next, check the files you attached in QField from QGIS.
Transfer the QField project package from the mobile device to your computer and open the project file in QGIS. You can also synchronize with the original QGIS project using the QFieldSync plugin.
Open the attribute table for the features you edited in QField to see the paths of the attached files.

If you check the QField project folder in a file explorer, you can see that the attached files are stored in the files folder.

files folder by default. If you set the viewer type to Image, Video, or Audio, the default folders are DCIM, video, and audio, respectively.Tips for getting the most out of attachments
This section introduces a few practical tips for entering data in QField more efficiently.
Record photos and videos with one tap
In the attribute form settings of the layer properties in QGIS, you can set the Integrated Document Viewer type to the kind of file content: image, audio (recording), or video.
With this setting, QField adds a shortcut button to the attachment attribute, so you can record a specific kind of multimedia with one tap.

For example, if you select Image, a camera button replaces the file attachment icon, and you can take a photo on site with one tap.

Setting the Integrated Document Viewer type also lets you see images registered in QField in the QGIS attribute form.

Set a maximum size for attached images
Setting a maximum size for attached images saves project storage. You make this setting in QGIS.
From the menu bar, choose Project → Properties.

In the project properties dialog, select the QField tab. This tab appears once you install the QFieldSync plugin.
Click the Attachments and Directories tab to set Maximum allowed width or height (in pixels) of image attachments.

For example, if you set the maximum size to 800 pixels, images registered afterward are automatically compressed to that size.

Add location and a timestamp to attached photos
You can automatically add the shooting time, location, and other custom information to photos.
To set this up, select the QField tab in the QGIS project properties and click the Attachments and Directories tab. Then click the Settings button for Customize image stamping details.

Check Always stamp images taken using the QField camera to show information such as the date, time, and coordinates. You can also customize the information shown by editing the expression in Details template.

With this setting applied in QField, photos you take automatically include information such as the shooting date, the latitude and longitude of the location, and the altitude.

Customize attachment file names and folders
By default, an attachment file name follows the format “layer name_date and time_attachment file name”. However, you may want to base file names on the value of a specific attribute. You can change this on the QField tab in the properties of the target layer.
For example, to name files in the files folder in the format “attribute value_date and time.extension”, go to Attachments Settings and click the ε button in the Naming Expression column of the row for the target attribute. Then enter 'files/' || "attribute_name" || '_' || format_date(now(),'yyyyMMddhhmmss') || '.{extension}'.

With this setting, attachments are automatically named by combining the attribute value of the feature with the date and time.

To organize attachments into folders by registration date, enter the expression 'files/' || format_date(now(),'yyyyMMdd') || '/' || format_date(now(),'yyyyMMddhhmmss') || '.{extension}'.

This sorts attachments into folders automatically, by the date you registered the photos.

Conclusion
This article showed how to set up attachment attributes in QField and how to use photos, videos, recordings, sketches, and other media in field surveys. These features make it possible to collect more accurate and detailed data than with traditional paper-based surveys.
The image attachment feature also offers more advanced options. For details, see the following page.


QGIS LAB is a comprehensive information hub for QGIS, the open-source GIS software. Under the concept of “Geospatial for Greater Good,” we share the knowledge and skills to open up the world through location data.


