- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2025 11:01 AM
Are you talking about special characters in attachment name?
Can you elaborate more about your use case?
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2025 12:34 AM
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;
}
}
Result
My file has special characters
Please mark my answer correct and helpful if this works for you
Thanks and Regard,
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2025 01:01 AM
Hi @SanjivMeher
When we try to attach a file to the attachment type variable in a record producer, the system should prevent the file from being attached if the file name contains special characters.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2025 01:16 AM
Hi @D V Sandeep ,
Did you check my solution ? I also did for file name only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2025 02:46 AM - edited 12-02-2025 03:02 AM
Hi @Sarthak Kashyap
Thanks for your response. I checked your solution, but it is still not working for me. The system is still allowing files with special characters in the name to be attached. Please check the attached screenshot.
FYI, I have also used the variable attribute 'allowed_extensions=csv' for this attachment type variable.
Please check the below client script: