Question
Alotaibi
Last activity: 15 Jun 2018 14:46 EDT
How can I prevent the user from change the extension name of attachments
Hi Team
In my application the user can attach files ex (gif , png , pdf) to work object.
I'm using CallVirusCheck , it's working fine, but the issue is when the user trying to change the extension name of the file (for example the name of file is "https" and the type of the file is "docx" when the user change the extension name to "pdf " ) <<please see attach "change" and "after change"
the validation it's not working and the system accepts not allowed types of attachments <<please see attach "after attach".how can i solve this issue ?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Alotaibi
Thanks team
we solved this issue by using when condition @endsWith ".pdf"
Pegasystems Inc.
IN
What do you mean by validation is not working ?
Do you mean, logic which you have written in CallVirusCheck activity is not working ?
If yes, Have you added Page-Set-Message in case your validation logic returns false ?
When I added Page-Set-Messages step in CallVirusCheck activity, PRPC is unable to add attachment
Alotaibi
Hi Prajendra
I use CallVirusCheck activity and call data transform inside it with name "CallVirusCheck" <<please see a copy of the attachment "CallVirusCheck"
the issue is that when the user is trying to attach a file with type docx and name (File.jpg.docx) is allowed. and in my requirement shouldn't be allowed this kind of file to attache. could you please give me advice to solve this issue.
kind regards
-
Ravi Ramineni
Pegasystems Inc.
IN
Hi ,
To solve the problem, You should not use the Data Transform rule. you need to add the Java step in CallVirusCheck activity and write the custom logic in Java step.
The logic should be like, If attachment name contains more than one dot then file name is invalid. You can add more conditions based on your requirement
Pegasystems Inc.
IN
Hi,
Can you respond pega version along with above queries asked by Prajendra in above post ?
Alotaibi
Hi chandrasekhar_g
pega version is 7.3.1
Pegasystems Inc.
US
Just a thought.
Why don't we make the field disabled so that when the user uploads the file, they will not be able o modify the name itself.
Please, let me know in case I misunderstood anything.
-
Onkar Yerawar Abishek Sekar
Accepted Solution
Alotaibi
Thanks team
we solved this issue by using when condition @endsWith ".pdf"