Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Add a file input in account profile

Started by Samuele Masetto 7 years ago · 0 replies · 642 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 Japhy, 2 weeks ago
2 272 4 days ago
Forms & Blueprints · by FrViPofm, 4 weeks ago
5 330 4 weeks ago
Forms & Blueprints · by Ton Haarmans, 6 years ago
13 2321 8 months ago
Forms & Blueprints · by Hugo Oliveira, 9 months ago
0 782 9 months ago
Forms & Blueprints · by Flachy Joe, 10 months ago
9 871 10 months ago