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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Forms & Blueprints

Add a file input in account profile

Started by Samuele Masetto 6 years ago · 0 replies · 485 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, 5 years ago
13 1136 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 61 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 135 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 110 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 129 7 months ago