Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Add a file input in account profile

Started by Samuele Masetto 7 years ago · 0 replies · 722 views
7 years ago

Hi,
I'd like to add a file field in account, so registered user can upload a file through /user_profile page.

I modified pages/user_profile/profile.md adding:

YAML
        curriculum:
            type: file
            label: Curriculum
            destination: 'user://accounts/cv'
            multiple: false
            filesize: 5
            accept:
                - '.pdf'

and config/plugins/login.yaml

YAML
user_registration:
  enabled: true
  fields:
    ...
    - curriculum

But when I save, the file was not uploaded, registered and saved.

I tried to investigate, I don't really know, but when I update the profile, at
Row 889 of plugins/login/login.php, if I dump:

PHP
dump($flash->getFilesByFields(true));

it returns an empty array.

Thank you for your help.

I admin panel instead, using admin-addon-user-manager plugin, the file was saved correctly.

Thank you for your help.

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Anna, 2 days ago
2 53 16 hours ago
Forms & Blueprints · by Anna, 3 days ago
7 82 16 hours ago
Forms & Blueprints · by Anna, 1 week ago
5 186 6 days ago
Forms & Blueprints · by TomW, 1 month ago
3 379 1 month ago
Forms & Blueprints · by Japhy, 2 months ago
2 595 2 months ago