Skip to content
Grav 2.0 is officially stable. Read the announcement →
Forms & Blueprints

Add a file input in account profile

Started by Samuele Masetto 6 years ago · 0 replies · 572 views
6 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 Ton Haarmans, 6 years ago
13 1863 6 months ago
Forms & Blueprints · by Hugo Oliveira, 7 months ago
0 451 7 months ago
Forms & Blueprints · by Flachy Joe, 8 months ago
9 548 8 months ago
Forms & Blueprints · by Augustus, 9 months ago
7 570 9 months ago
Forms & Blueprints · by Julien, 9 months ago
10 590 9 months ago