I have a QGIS project saved under G:\USER\xyz\projects\QGIS.qgz

In the same folder is a subfolder Pictures. My layer contains a column with the picture names (For example: 101.jpg). The picture 101.jpg is within this subfolder Pictures. How can I tell QGIS to connect this picture name in the layer's column to that actual picture in the subfolder?

My configuration

In the screenshot you can see my configuration - I think it should work like this? Relative path checked and in the default path field I wrote the name of the subfolder. It is not working though. Any thoughts? I want to achieve that the whole project folder is portable so I can use it with QField.

  • 1
    I never used the attachment widget, but since Pictures is the folder name, have you tried to change the Storage Mode to Directory paths?
    – ahmadhanb
    Jun 2, 2020 at 7:29
  • that does not work unfortunately - i think that option should be changed to Directory Paths if the columnof the layer contains full paths and not file names?
    – sn1ks
    Jun 2, 2020 at 7:39

1 Answer 1


I found the solution:

With this expression it takes the project path and adds the desired subfolder to it:

file_path(@project_path) + '\Pictures\'

enter image description here

Unfortunately this does not work for QField

As with the newest version of QField Sync, this is solved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.