Glenmark (Form 4)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 32s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 32s
Details
This commit is contained in:
parent
b80be9ff7f
commit
5fd1b86619
|
|
@ -353,7 +353,28 @@
|
|||
|
||||
syncLOBGTotal();
|
||||
|
||||
$('#field-upload_supporting_document').on('change', function () {
|
||||
let file = this.files[0];
|
||||
|
||||
if (file) {
|
||||
let allowedTypes = ['image/png', 'image/jpg', 'image/jpeg'];
|
||||
let maxSize = 10 * 1024 * 1024; // 10 MB
|
||||
|
||||
// Type validation
|
||||
if (!allowedTypes.includes(file.type)) {
|
||||
alert('Only PNG, JPG, and JPEG files are allowed.');
|
||||
$(this).val('');
|
||||
return;
|
||||
}
|
||||
|
||||
// Size validation
|
||||
if (file.size > maxSize) {
|
||||
alert('File size should not exceed 10 MB.');
|
||||
$(this).val('');
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue