I'm working with summernote, the problem we currently are facing is, how to limit the size of a file when a user pastes it. We already disabled the tool, so no upload through that.
The only way that images can be added is through paste (ctrl+v). We want to allow only images under 2 MB to be added.
$('textarea.summernote').summernote({
toolbar:[],
height: h,
maximumImageFileSize: 2097152,
callbacks: {
onPaste: function(e) {
//Do Something
}
}
});
Even though we specified maximumImageFileSize
, it's still possible to paste images above the 2 MB limit, or to resize it.