Zenova : Glipiq & Sitazit Tracker form changes 1
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m39s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m39s
Details
This commit is contained in:
parent
128c100ac7
commit
a7ad163299
|
|
@ -297,26 +297,24 @@ $('#field-select_brand').on('change', function () {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#field-file_upload').on('change', function () {
|
$('#field-file_upload, #field-upload_sitazit_rxn, #field-upload_glipiq_rxn').on('change', function () {
|
||||||
let file = this.files[0];
|
let file = this.files[0];
|
||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
let allowedTypes = [
|
let allowedTypes = [
|
||||||
'application/pdf',
|
'application/pdf',
|
||||||
'image/png',
|
'image/png',
|
||||||
'image/jpg',
|
|
||||||
'image/jpeg'
|
'image/jpeg'
|
||||||
];
|
];
|
||||||
|
|
||||||
let maxSize = 10 * 1024 * 1024; // 10 MB
|
let maxSize = 10 * 1024 * 1024; // 10 MB
|
||||||
|
|
||||||
// Type validation
|
|
||||||
if (!allowedTypes.includes(file.type)) {
|
if (!allowedTypes.includes(file.type)) {
|
||||||
alert('Only PDF, PNG, JPG and JPEG files are allowed.');
|
alert('Only PDF, PNG, JPG and JPEG files are allowed.');
|
||||||
$(this).val('');
|
$(this).val('');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Size validation
|
|
||||||
if (file.size > maxSize) {
|
if (file.size > maxSize) {
|
||||||
alert('File size should not exceed 10 MB.');
|
alert('File size should not exceed 10 MB.');
|
||||||
$(this).val('');
|
$(this).val('');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue