Replies: 4 comments 2 replies
-
You should report that to the main Symfony repository, or maybe start a discussion thread there to get some help. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
Twig forms are part of Symfony, not Twig :) |
Beta Was this translation helpful? Give feedback.
-
I know, but my form is correct. The problem appears when the file input is supposed to be "filled" with data. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I use Symfony 6.3.12 ang Twig Extra Bundle 3.8.0.
I'm working on a form with Symfony in which users can create a collection of rows, each contains a file upload and a couple fields. Nor collection type or form type is mapped to an entity, I process submitted data by myself back in controller.
Submitting new data works but when I inject persisted data in the form for edition with an existing file (an instance of Symfony\Component\HttpFoundation\File\File containing absolute path to file on the server), the file is not passed to the form field, and this one remains empty with "No file selected" displayed in the template.
Here is my code:
Controller:
JustificatifCollectionType.php
JustificatifType.php
Template
form-collection.js
I cannot figure out what I did wrong.
Does anyone see what is missing ?
Thanks by advance.
EDIT: if I upload another file in the already existing row, this one is not updated but another row is created.
Beta Was this translation helpful? Give feedback.
All reactions