Expand my Community achievements bar.

File Attachment Issue

Avatar

Level 2

I am having an issue with file attachment script.  If several files are attached (3+) and removed, they can no longer be opened.  Also, the actual attachments are not being capture in the list on the form properly.

Thanks for your assistance.

Attachment Fail.JPG

7 Replies

Avatar

Level 2

form1.page1.Block13.FileAttachments.attachmentsList::ready:layout - (JavaScript, client)

if( attachmentsList.length != 0){

    this.caption.value.resolveNode("#text").value = "       List of Attachments ["+attachmentsList.length+"] (All Files Must be Attached Prior to Signing, i.e., for any digital signature on the form)";

}

else{

    this.caption.value.resolveNode("#text").value = "       List of Attachments (All Files Must be Attached Prior to Signing, i.e., for any digital signature on the form)";

}

form1.page1.Block13.FileAttachments.AddAttachment::click - (JavaScript, client)

var oObj = event.target;

var fileAttachments = oObj.dataObjects;

if( fileAttachments == null){

    if (oObj.importDataObject(0) != false){

        var oDataObj = oObj.getDataObject(0);

        attachmentsList.addItem(oDataObj.path);   

    }

}

else if( fileAttachments != null){

    if (oObj.importDataObject(fileAttachments.length) != false){

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

        attachmentsList.addItem(oDataObj.path);

   

    }

}

else{    app.alert("Error processing this request.");}

form1.page1.Block13.FileAttachments.ViewAttachment::click - (JavaScript, client)

var oObj = event.target;

var sAttachObjName = attachmentsList.selectedIndex;

if (sAttachObjName != -1){

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

}

form1.page1.Block13.FileAttachments.RemoveAttachment::click - (JavaScript, client)

var oObj = event.target;

oObj.removeDataObject(attachmentsList.selectedIndex);

attachmentsList.deleteItem(attachmentsList.selectedIndex);

Avatar

Employee Advisor

Hi There,

Please share the sample form and also the version of Acrobat and designer that you are using?

Avatar

Level 2

I am using Designer 6.2.  I don't have the option to upload a PDF, only images or hyperlink.

Avatar

Employee Advisor

Hi Lane,

You can share it via shared drive.

Avatar

Level 2

Mayank,

Did you have luck with the issue?  I have determined the feature will only work for a couple attachments that are added or removed a minimal number of times.

Avatar

Employee Advisor

I am unable to catch hold of the issue but the problem is even if you have two files also. The files are unable to open once you have clicked on remove attachment after selecting a file. It's like the list still has the name but the value of attachment in null.