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 ?

0

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.