You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used FileInput with the ability to download via Ajax. The file is added and uploaded to the server. When I click the Delete button, the file is also deleted from the panel, but no request is sent to the server. When the page is loaded, the initial (already downloaded files) are added - from there they are deleted normally by Ajax. How to make sure that when a file is deleted, a deletion request is sent to the server.
I used FileInput with the ability to download via Ajax. The file is added and uploaded to the server. When I click the Delete button, the file is also deleted from the panel, but no request is sent to the server. When the page is loaded, the initial (already downloaded files) are added - from there they are deleted normally by Ajax. How to make sure that when a file is deleted, a deletion request is sent to the server.
$fileForm = $form->field($requestFilesForm, 'uploadFiles[]')->widget(FileInput::class, [ 'language' => 'ru', 'options' => [ 'multiple' => true, 'accept' => '', ], 'pluginOptions' => [ 'previewFileType' => 'image', 'deleteUrl' => Url::to(['delete-file'],true), 'uploadUrl' => $model->id ? Url::to(['upload-files', 'id' => $model->id]) : null, 'uploadExtraData' => [ 'id' => $model->id, ], 'overwriteInitial' => false, 'showPreview' => true, 'initialPreview' => $files, 'initialPreviewFileType' => 'image', 'initialPreviewAsData' =>true, 'initialPreviewConfig' => $initialPreviewConfig, 'pluginEvents' => [ "fileuploaded" => "function(event, data, previewId, index) { console.log(data) }", ], 'maxFileSize' => 50000 ], ])->label('Прикрепленные файлы');
The text was updated successfully, but these errors were encountered: