In creating/editing a form in LiveCycle, I would like to create a button that my Reader users can click to allow them to attach a file(s) to the form, which they will then submit back to me. I know that the user could simply go to Tools, Comments & Markup, Attach a file as a comment, but this will be too complicated for my very low-tech users. What is the most efficient way of creating this function? Thanks.
My Product Information:
LiveCycle Designer Pro 8 / Windows
Offline

Follow this link:
http://www.box.net/shared/qimy7l9h7i
Open the PDF (Developing Acrobat® Applications Using JavaScript), search for - keyword - attachment. Select the method you want to use.
Offline

Make sure your LiveCycle Form is saved as an Acrobat 7 (Static) PDF form so it will be compatible with more users.
Offline

This code (button click) will email the current PDF as an attachment.
var myDoc = event.target;
myDoc.mailDoc(true, "management@company.com", "supervisor@company.com", "ceo@company.com", "Employment Application Form");
++++++++++++++++++++++++++++
If the file attachment is not FDF, XDP, XFDF, HTML, XML, XFD, OR PDF, use this button click script in LiveCycle.
app.mailMsg(false, "youremail@yourcompany.com; otheremail@yourcompany.com", "","",
"This is the subject", "Please use your email application to attach the excel spreadsheet file to this message.");
This code allows the user to browse their hard drive for the file to attach.
Note: In LiveCycle Designer, you must ensure that the scripting language for the event is set to JavaScript
so that the script will execute correctly at run time.
Make sure all incoming file attachments are throughly check for virus and other nasty programs.
Offline

The solution I posted is the simpliest way to instruct the user to browse their hard drive for the file to attach.
I'll post another method using LiveCycle that is a little more complicated so I'll need time to write the complete instructions.
Offline

After further review and testing of a few scripts, I discovered that the only solution to this issue is the one that I posted in my initial response with instructions in the body of the email on having the user attaching a file.
Here are a couple on incomplete scripts that will work in LiveCycle, which you can experiment with.
Put the following javascript on "click" event of a button will pop up a file browser that you can select a file from your client's hard drives.
var myDoc = event.target;
var sFile = "myFile"
myDoc.importDataObject(sFile);
Here is the code to display the selected file name in a text field:
var myDoc = event.target;
var sFile;
myDoc.importDataObject(sFile);
var myDataObject = myDoc.getDataObject(sFile);
TextField1.rawValue = myDataObject.path;
According to the Acrobat JavaScript Scripting Reference, Reader can not use the "importDataObject", unless the PDF has had Extended Reader Usage Rights applied to the PDF. If you manage to get the script to work, you'll have to enable Extended Reader Usage Rights or the person receiving the form must open it in Acrobat Pro OR render the form through Reader Extensions with attachment enabled.
Sorry, I couldn't help.
Offline
Eugene, I am wanting to do the same thing as mrogers, but I am unable to access your link which looks like it may have the answer. Do you know why this is?
Offline
Eugene,
I am also wanting to do the same thing and there are no shared files when I open the link.
I would appreciate any help
Offline
AcrobatUsers.com >> User Groups • News • Events • Articles • Blogs • How To • Resources • Member Log in