if( resp.success == true ){
toastr.success( file.name + ' has been added.')
fileElement.classList.add("dz-complete");
}else{
toastr.error( 'Error:' + resp.msg);
var fileElement = file.previewElement;
fileElement.classList.add("dz-error");
var errorMessageElement = fileElement.querySelector(".dz-error-message");
if (errorMessageElement) {
errorMessageElement.textContent = "Custom error message here";
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter