Preventing File uploads with double extensions and remove unsaved record from the attachments applet
Siebel IP 22.5
Hi All,
I am trying to implement a check to prevent file uploads with double extensions and remove unsaved records from the attachment applet.
I have the below code in PreInvoke method in PM file for the attachment applet. However, this doesn't seem to be working. Could you please advise.
function PreInvokeMethod( methodName, psInputArgs, lp, returnStructure)
{
if( methodName === "NewFileAttachment"){
var fileInput = document.querySelector('input[type="file"]');
console.log("fileInput: " + fileInput);
var ext = fileInput.value.split(".").pop();
var acceptedExts = ["pdf", "docx", "doc", "gif", "jpeg", "jpg", "jpe", "tiff", "tif", "png", "xlsx", "xls"];
console.log("ext: " + ext);
if(acceptedExts.indexOf(ext) === -1)