Siebel Open UI, Tools, Scripting and EAI (MOSC)

MOSC Banner

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)

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center