Media files in "DCIM/", "files/", etc. not synced by QFieldCloud
What is the bug or the crash? What were your expectations and what actually happened?
When using Attach a gallery item on Android, QField correctly copies the image into the project’s files/ directory and writes the relative path into a TEXT attachment field. After syncing via QFieldCloud, the desktop mirror contains the files/ folder but none of the image files. In the attribute table, the path remains displayed (e.g., files/photo_20250826194052514_1000007416.jpg), producing a dangling reference.
Expected
Desktop project directory contains:
files/ placeholder.txt photo_YYYYMMDD_HHMMSSnnn##########.jpg_
The photo field value opens the image successfully.
Actual
Desktop project directory contains:
files/ placeholder.txt (missing the new JPG)
The photo field shows the relative path (e.g., files/photo_20250826194052514_1000007416.jpg) but the file is not present.
Additional observations
- On mobile device, QField Project Folder shows the copied image does exist at:
Android/data/user/0/ch.opengis.qfield/files/QField/projects/
- Changing the default path to DCIM or attachments shows the same behavior (folder may exist; files still not uploaded).
- App permissions: Photos & media = Allow all.
- Always pressing Save prior to sync.
- Re-syncing does not bring the missing files.
Steps to reproduce the issue
- In QGIS, create a new project; add a GeoPackage point layer with fields:
- name TEXT
- photo TEXT (length 500)
- Configure photo field as Attachment configured as such:
- Editable: Yes
- Storage Type: Select Existing File
- Default Path: files (or DCIM, attachments, etc)
- Store Path As: Relative to Project Path
- Storage Mode: File Paths
- Display Resource Path: Yes
- Display Button to Open File Dialogue: Yes
- Use Hyperlink for Document Path: No
- Integrated Document Viewer: Image (Height and Width set to Auto)
- No Constraints or Default Values
- Create a files/ directory alongside the .qgz and add placeholder.txt so it’s tracked.
- QFieldSync → Cloud Layer Action = Offline editing → Upload to QFieldCloud.
- On Android (QField), delete any old local copy, then download fresh from QFieldCloud.
- Add a point → open form → Attach a gallery item → pick any image → Save.
- Sync to QFieldCloud.
- On desktop, pull the project from QFieldCloud.
Workarounds tested:
- Pre-creating files/ with a placeholder file
- Declaring files (and also files/) under Project → Properties → QField → Attachments and Directories
- Fresh re-download of project on device before testing
- “Attach a gallery item” only (no camera capture)
- Permissions set to Allow all
Version
QField 3.7.5
Operating system name
Android
Operating system version
14
Reinstall QField
- [x] I have a fresh install of the latest QField version, but the problem persists.
- [x] Problem can be reliably reproduced, doesn't happen randomly.
- [x] Problem happens with all files and projects, not only some files or projects.
Additional context
QGIS (desktop): 3.34.15 (386f2583) Qt version: 5.15.13 Android: 14 Project storage: QFieldCloud (not Cable) Editable layer format: GeoPackage (.gpkg) Project Properties → QField → Attachments and Directories: → Contains: files (and also tried files/)
@georgiaslim , there might be a bit of a misunderstanding here. More specifically, this:
Create a files/ directory alongside the .qgz and add placeholder.txt so it’s tracked.
While a bit counterintuitive, merely adding a directory and a placeholder file to have QFieldSync upload that subfolder file resulting in the folder visible on app.qfield.cloud does not mean the subfolder and its content will be packaged when downloading the project in QField.
You must declare these subfolders in the Project → Properties → QField → Attachments and Directories table widget, as you were hinting in you workaround section.
When you referred to "workaround section" did you mean that these steps provided there did lead to successful synchronization? If so, you have actually described not the workaround but the steps to make it work :)
@nirvn Apologies for not being clear, but no the sync is still not successful with those "workaround"steps. Even when the subfolder is declared.
Hi @georgiaslim,
I've conducted a test using the workflow described by you, and for me, the upload of attachments worked correctly.
In one of the steps, you mentioned that "Default Path: files (or DCIM, attachments, etc)" should be empty. Could you confirm if you specified a default path there?
If yes, could you try setting it as empty and try the upload again?
If not, could it be possible for you to share a sample project of your project that is not uploading the pictures to the cloud?
There the steps I've made:
Test Issue 6620 - Media files in DCIM files etc not synced by QFieldCloud 001.pdf
https://github.com/user-attachments/assets/7673bb36-eb98-45b4-a4dd-c59568ef1945
Hello @SeqLaz
Sorry for not responding sooner.
I followed the steps in your PDF exactly. The only difference was my folder for attachments is named "DCIM." Everything else I followed EXACTLY as you did (even the names of files and fields). But it did not work for me; the attached photos are not uploading to QFieldCloud and do not show up in the DCIM folder on there (see screenshot). I did one feature with "Attach from gallery" and another feature with the "Take photo" button, and neither one is successful in uploading to QFIeldCloud.
I checked the Changes in QFieldCloud, however, and it says they were applied successfully. I am completely stuck.
Even though it stored the path properly, no images were downloaded.