Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Nicolas-Bouteille opened this issue Oct 27, 2020 · 0 comments
Open

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

Nicolas-Bouteille opened this issue Oct 27, 2020 · 0 comments

Comments

@Nicolas-Bouteille
Copy link

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."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant