Expand my Community achievements bar.

Attachment is not opening in client's end


Level 2


I have made a static XFA form using livecycle designer ES4. In this form open button is not working in client's end. No file is opening after selecting from listbox although it is present in navigation panel. I can open the attachment by clicking open button in Acrobat pro dc but same thing is not happening in client's end (tried with both Acrobat pro XI & Pro DC).

I am using below code:

//In add button:

form1.page2.AddAttachment::click - (JavaScript, client)

var oObj = event.target;

var fileAttachments = oObj.dataObjects;//dataObjects returns all dataObjects(attachments)in the pdf

if(attachmentsList.length > 0)



var oDataObj = oObj.getDataObject(fileAttachments.length);


console.println("The attachments size is...."+fileAttachments.length);

NoOfAttachments.formattedValue = fileAttachments.length+1;




//we need to associate each file attachment  imported into the document with a key

//then get the file attachment's name and add it to the drop down list


var oDataObj = oObj.getDataObject(counter.value);


NoOfAttachments.formattedValue = 1;


//In remove button:

form1.page2.Button1::click - (JavaScript, client)

var oObj = event.target;



//In open button:

form1.page2.ViewAttachment::click - (JavaScript, client)

var oObj = event.target;

var sAttachObjName = attachmentsList.selectedIndex;


oObj.exportDataObject({ cName: sAttachObjName, nLaunch: 2 });

Would anyone please share why this is happening? Any help appreciated.


2 Replies


Level 4

Check the security permissions in Adobe Acrobat.


Level 10

Hi, In your code what is the NoOfAttachments object, I not sure how you assign a number to a formattedValue should throw an exception unless it is a string.  Do you have the "Show console and errors and messages" set in Acrobat?  But I don't think that is your problem and I would suspect the permissions as well, is it just some file types?  There are an number of customisations that can be made when Reader is installed.