Sarthak Kashyap
Mega Sage

Hi @D V Sandeep ,

 

I check for your problem in my PDI and it works for me, I checked for name in file name please check solution below 

 

I created a onChange client script on attachment variable and add below code

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }

    alert("Called = " + g_form.getValue('add_here'));

    var attachmentWidget = g_form.getControl('add_here');
    alert("attachmentWidget = " + JSON.stringify(attachmentWidget));
    var fileName = attachmentWidget.displayValue
    var invalidChars = /[%$@()&<>'"]/;

    if (invalidChars.test(fileName)) {
		alert("Your file name have invalid characters please remove and add");
		g_form.clearValue("add_here");
		return false;
	}

    }

SarthakKashyap_0-1764664387302.png

 

Result

 

My file has special characters

SarthakKashyap_1-1764664453279.png

 

SarthakKashyap_2-1764664467292.png

SarthakKashyap_3-1764664478111.png

 

Please mark my answer correct and helpful if this works for you

Thanks and Regard,

Sarthak