I have a form that I'm working on that requires a file upload script. I incorporated it based on the sample on this thread (https://forums.adobe.com/message/1976160#1976160). The form has hidden subforms so there's some heirarchy going on but I'm not able to figure out how to factor that into the script so the form allows the user to find the file and attach it, etc.
How would I modify the script in the sample for subforms? What am I missing?
I was able to get a slightly better understanding based off combining this thread (https://forums.adobe.com/thread/1235441) with this one (https://forums.adobe.com/message/10056473). Again; might make perfect sense for some but I'm still growing in coding. I was just happy to get it to work. Now, it could certainly be coded better, but for now, my client seems happy with the solution. As time permits (and if projects EVER slow down enough to allow), I'll try and get a better understanding of what's going on in the code and modify it so that it incorporates some more validation, control, etc.
Here's what I used for each of the buttons for attaching, opening, and removing file(s):
var a = myRemoveObject.getField("Main.sfAttachmentRequest.attachmentsList");
a.deleteItemAt(); // delete current item, and...
a.currentValueIndices = 0;
The example I built this from uses a list box to display the attached files which is great if attaching multiple files, but I'd like to figure out how to modify it for only attaching/displaying single files, as well. Probably a simple change.
Do you want to add an attachment to your file via scriptings? Where do you want to use the fiorm finally – Adobe Reader or Acrobat? For the former you'll need a LiveCycle server with the Reader Extensions module to enable this function in the form, for the latter, you can use the importDataObject() method i.e.