0

I am using sonata-admin bundle and i have weird problem with uploading. I am not sure if it is related with Sonata or Symfony. I am not able to repopulate a file widget. If i have any errors the file which is uploded always disappear from my form, but the rest of inputs are repopulated correctly.

My solution base on the page: http://sonata-project.org/bundles/admin/master/doc/cookbook/recipe_file_uploads.html

Question:

Do any of you have an idea what can be wrong?

user1119698
  • 157
  • 2
  • 15
  • It is OK, if you have any form error you have to select the file again. You cannot set default value for file type, see http://stackoverflow.com/questions/8323010/putting-default-value-in-input-type-file. – Lkopo Sep 08 '14 at 15:51
  • ok, but i'd like to know how does it handle by any of you :) – user1119698 Sep 08 '14 at 16:17
  • Why not using a media bundle field for uploading files ? – M Khalid Junaid Sep 10 '14 at 19:50
  • Because I'm in the middle of the project and I have concerns that something may be broken and there will be too lot of changes. Unfortunatelly my effort didn't assume this kind of job ... – user1119698 Sep 11 '14 at 17:09
  • There is an answer here: http://stackoverflow.com/questions/16747278/symfony2-file-lost-upon-form-error – Ian Phillips Dec 01 '15 at 01:11

0 Answers0