Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Upload / Attach File in form

Avatar

Former Community Member
I'm new to the LiveCycle Designer, so please bare with me.



I need to design a form that will allow a user to link/attach files. When the user submits the form we would like the form to link to the documents like a hyperlink.



Please help the newbie.
284 Replies

Avatar

Former Community Member
Hi Paul



Can you please send the script to me as well



meeta.chawla@gmail.com

Avatar

Level 10
Thanks Paul for the sample!!



I found that the ListBox went blank when the form was re-opened. Why does this happen?



I managed to get the ListBox repopulated with the file names, but when the user selects them and clicks open, it says "No file to open".



Ideally the user should see the files that are attached and select specifically which one they want to open.



Do you think this is possible?



Thanks again,



Niall

Avatar

Former Community Member
Hi Paul,

Wow your script is popular!

Can I also please obtain a copy to:

email.me.456 @ gmail.com (no spaces)



Cheers and thx

Brett

Avatar

Former Community Member
The state of the form is not kept when it is saved. You coudl modify the code to read the attachments and repopulate the list when the file is opened.



Brett I just sent you the sample.

Avatar

Former Community Member
Hello,



may you please send me the script as well?



geppert.thomas@gmx.de



Thanks!

Thomas

Avatar

Former Community Member
Hello Paul,



Can I also get a copy of the most popular upload script ever? Please send to damien@shareholderactive.com



Thanks so much,



...Damien

Avatar

Former Community Member
Can I also get a copy of your script at mohamed.jalid(at)publilink.be

Thanks so much

Avatar

Former Community Member
Hello Paul,



I use the script and it works fine. I have a question, Is possible don´t show any message when you remove an item of the list?



Thanks.

Avatar

Former Community Member
Sure just remove this line:



app.alert(sFile);



line 6 in the script on the click event of the button. That was in there for debugging purposes.

Avatar

Former Community Member
Here's my problem. I am trying to make a form in Designer 7.0 and I would like to have the user attach images to it. I made an image field and this works great for getting the images in the form, but I am unable to extract the images from the form when it comes back with all it's XML data. I can't seem to find anyone with this problem, so maybe it's just that I'm not familiar enough with Designer, anyway help is appreciated. Thanks



Jonathan



jhickerson@harris-assoc.com

Avatar

Former Community Member
If you are using an image field then the image will be in the data file that is produced. The contents of the field will be a base64 encoded string that represents the image and an attribute that tells you what image type it is.

Avatar

Former Community Member
Paul,

You are a life saver! Please send this script to me as well at:



ryan(at)gemvision.com



Many Thanks!

Avatar

Former Community Member
Paul,



I am having problems with error codes when I use the script in my LiveCycle document. For example I get JavaScript errors like: DataObject=[0], after I add a file. And sFile is:Myfile0. I am still able to attach the document and it works but I was wondering what I may have done wrong to produce those errors?



Thank you for any help you can provide.

Avatar

Former Community Member
Those are not errors but messages that the wscript is putting out to indicate what is goinng on in the script. You can comment out the app.alert commands (where you see the messages coming out) with a // at the beginning of the line.

Avatar

Former Community Member
my line of code didn't show up darn it.



well I added the a // before the line of code and then it wouldn't let me save it said i had an error.



back to square one i guess :)