0

I'm trying to use the php upload_progress feature with symfony2. I set my session.upload_progress.prefix and session.upload_progress.name in my php.ini. My form below :

<form id="form-import-file" action="" method="post" {{    form_enctype(form) }} class="form-horizontal">                                    
    {{ form_widget(form.file, { 'attr':{'class':'input-file-import'}}) }}
    {{ form_rest(form) }}     
    {{ form_errors(form.file) }}
    <input type="hidden" name="{{ upload_progress_name }}" value="123" />
    <button type="submit" class="btn btn-success">Submit</button>
</form>

where upload_progress_name = ini_get("session.upload_progress.name").

The upload is okay, but the session doesn't show any upload infos. Any help ?

user2733521
  • 439
  • 5
  • 22

1 Answers1

0

Ensure that <input type="hidden" name="{{ upload_progress_name }}" value="123" /> is before the file input fields. Just place it under the form tag. Also what helped me out is this list: issues on php upload progress

Finally there is good symfony2-bundle, which may help you to not reinvent everything new.OneUpBundle With this bundle you can pick a Frontend solution or create your own one.

Community
  • 1
  • 1
CiTNOH
  • 186
  • 1
  • 8