Is there a way to customize mediaManager so that when someone want to upload a file and it is more than 10 mb’s then they should confirm the upload before uploading. e.g a dialog box
thanks alot.
Is there a way to customize mediaManager so that when someone want to upload a file and it is more than 10 mb’s then they should confirm the upload before uploading. e.g a dialog box
thanks alot.
Maybe a starting point : javascript - Is it possible to have popup options before adding a file using Dropzone.js? - Stack Overflow
I do see the event in modules\media\widgets\mediamanager\assets\js\mediamanager.js
this.dropzone.on('addedfile', this.proxy(this.uploadFileAdded))
@apinard thanks for the Hint. it works as intended.
Just for future as a starting point
$(document).ready(function () {
let mediaManager = $('[data-control="media-manager"]').data('oc.mediaManager')
let mediaMangerdropZone= mediaManager.dropzone;
mediaMangerdropZone.on("addedfile", function (file) {
if(!confirm("Do you want to upload the file?")){
this.removeFile(file);
return false;
}
});
});