Am implementing the 2amigos file uploader it only displays the interface but does not show or upload any file
I have tried this:
<?= FileUploadUI::widget([
'model' => $evidence,
'attribute' => 'path',
'url' => ['media/upload', 'id' => $evidence],
'gallery' => false,
'fieldOptions' => [
'accept' => 'image/*'
],
'clientOptions' => [
'maxFileSize' => 2000000
],
// ...
'clientEvents' => [
'fileuploaddone' => 'function(e, data) {
console.log(e);
console.log(data);
}',
'fileuploadfail' => 'function(e, data) {
console.log(e);
console.log(data);
}',
],
]);
?>
Hey Geffory only putting widget on the view we can't upload files we have to create Controller according to the widget.In my project I normally use krajee File Input yii2 extension. anyway I found an example Controller from https://github.com/2amigos/yii2-file-upload-widget/issues/5
Controller Function
you can use this controller function and add modify your controller according to your need..