BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Hello,
I am currently
using the Uploader component to upload my files to the server. the problem is
that I can not limit the number of files to upload. I would like the user to
have a maximum of 3 files to upload and return an error message if he tries to
add more than 3.
Thanks in advance and regards,
onFileSelect(args) {
var fileLength = args.filesData.length + this.uploadObj.getFilesData().length;
if (fileLength > this.count) {
args.cancel = true;
document.getElementsByClassName('e-error')[0].innerHTML = 'maximum of ' + this.count + ' files to upload';
} else {
document.getElementsByClassName('e-error')[0].innerHTML = '';
}
} |
onFileSelect(args) {
var fileLength = args.filesData.length + this.uploadObj.getFilesData().length;
// if you need upload first 3 files means use this way.
if (fileLength > this.count) {
args.filesData.splice(this.count, args.filesData.length);
alert('maximum of ' + this.count + ' files to upload')
document.getElementsByClassName('e-error')[0].innerHTML = 'maximum of ' + this.count + ' files to upload';
} else {
document.getElementsByClassName('e-error')[0].innerHTML = '';
}
} |