Glenmark (Form 3)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 39s Details

This commit is contained in:
zeeshan 2026-05-26 16:22:40 +05:30
parent 2b24f95efb
commit b80be9ff7f
1 changed files with 23 additions and 0 deletions

View File

@ -285,7 +285,30 @@
}
);
$('#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;
}
}
});