kartik-v / yii2-widget-fileinput

An enhanced FileInput widget for Bootstrap 4.x/3.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)
Other
229 stars 96 forks source link

Cannot Delete Files Uploaded Via AJAX #45

Closed TNChalise closed 9 years ago

TNChalise commented 9 years ago

How can I setup my response so that I will be able to delete the file I have Just Uploaded ? [@kartik-v ]

I have been trying to delete files that are uploaded by ajax, but it seems this is not working for me. The image attached here, is the response that I have sent from server upon successful upload.

upload-response

My View File is:


    // Usage with ActiveForm and model
    echo $form->field($documents, 'document_path')->widget(FileInput::classname(), [
        'options' => ['accept' => 'image/*', 'multiple' => true],
        'pluginOptions' => [
            'uploadUrl' => Url::to(['documents']),
            'uploadExtraData' => [
                'mysecret' => 'secret',
            ],
            'maxFileCount' => 10
        ]
    ]);
kartik-v commented 9 years ago

Duplicate to kartik-v/bootstrap-fileinput#457. Refer the comment.