Skip to content

'enctype' => 'multipart/form-data' not needed #13

@Nicolas-Bouteille

Description

@Nicolas-Bouteille

Hello,
Thank you so much for sharing this! This is exactly what I need :)
I believe these lines are not necessary:

$form['#attributes'] = [
  'enctype' => 'multipart/form-data',
];

as it is automatically added to the form when we add a FormElement of type 'file'
see https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21Element%21File.php/class/File/8.2.x
"If you add this element to a form the enctype="multipart/form-data" attribute will automatically be added to the form element."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions