Bug #3344
[HR-Employee]Personal Data tambahkan validasi pada saat upload foto dengan nama special character.
Added by Muhammad Bintar 6 days ago.
Updated 6 days ago.
Files
- Status changed from New to QA Test
- Assignee changed from M Azid Wahyudi to Muhammad Bintar
dear masbin , udah bisa di test ya
package :
Xtype
maxFileSize = Ext.ComponentQuery.query('uploadfile[name=' + targetField_ + ']')[0].maxFileSize;
Ext.ComponentQuery.query('[name=FileMax]')[0].setValue(maxFileSize);
var form = Ext.ComponentQuery.query('form[name=FormFileUpload]')[0].getForm();
uploadfilename = form.monitor.items.items0.value
uploadfilenameSub = uploadfilename.substring(uploadfilename.lastIndexOf('\\') + 1);
fileName = uploadfilenameSub.split('.').shift();
var regex = /^[a-zA-Z0-9\s]*$/;
var invalidChars = fileName.split('').filter(char => !regex.test(char)).join('');
if (invalidChars.length > 0) {
var message = `File name contains special characters: ${invalidChars}.`;
Ext.Msg.alert('Invalid File Name', message);
return;
}
makasih
sudah di deploy ke client
Also available in: Atom
PDF