Problem uploading file to user profile via front-end page

Hello, i am building a web site in which everyone can create a user profile. Each user is allowed to write a small description of themselves ad attach a PDF file to their profile.

I have set up a blueprint for users with the two customs fields. (text and file)

 label: Présentation
 type: textarea
 size: medium
 label: Cv (pdf)
 type: files
 query: page.documents
 multiple: false
  template: cv

The file must be a pdf, i made it use a file blueprint.

The panel is working properly, allowing me to edit description and upload one pdf file per user.

Users do not have access to the panel.

I have successfully managed to allow users to change their descriptions with a form and the $kirby->user()->update().

                        'presentation' => $data['presentation'],
                        'cv' => $file

However it does not seems to work with this method for files.

Has anyone tried to build something like that ?

You would have to upload the file first to the user folder (you can use $user->createFile(), $user->createFile() | Kirby CMS), not sure if you are already doing this?

Also, a files field expects the data to be stored in yaml format, don’t know where and how you define $file.

This cookbook recipe, while it refers to pages, should help: Uploading files from frontend | Kirby CMS

Thank you for your help ! I was not uploading the file first to the user folder.
The file upload is now functioning proprely ! :grinning: