Expand my Community achievements bar.

SOLVED

Display Image from Attachment?

Avatar

Former Community Member

Using the sample file (AttachmentTest2_version8_launch_attachment_new.pdf) found here, http://209.46.39.53/thread/341433?decorator=print&displayFullThread=true, I'm using this for a form that also has an image field where the user clicks to add image to the form, and it works nicely, but would like to merge/combine it with the functionality of the image field where a user selects a pic and it displays on the form.  The image field did not give the option to be able to retrieve the pic when it was submitted, so I'm hoping to find a solution that once the user adds an image using the image field, that file could be automatically added to the attachment listing per the sample file.  In other words, in the sample, the user clicks 'add file' to select/add to list of files attached.  Is it possibe to capture the file and add as attachment from the image field, and then still be able to add additional attachments if needed.  The idea is to be able to display the image of whatever pic they have.  If there is a better way to accomplish, that would be great, and hope I've explained ok.  Thank you.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Extending with Acrobat does not give you that functionality ...thats why I said you need LiveCycle Reader Extensions server to accomplish this.

Paul

View solution in original post

9 Replies

Avatar

Former Community Member

One additional piece of info - in the sample file, and the form where I used sample, the 'add file' does not work once it has been distributed.  Before it's distributed, it works fine, but once it's distributed, with reader extended, that button no longer works - clicking doesn't do anything.  The other buttons do activate, but they are dependant on having a file in the list.  Thank you for any help on that, too.

Avatar

Former Community Member

The image field will take the image contents, base64 encode them, and put them into the data dom so that when you submit data the

image contents are there. It does not exist as something you can attach as a file attachment.

The distribute functionality will add code to override any submit buttons ......this could be what is happening to you.

Paul

Avatar

Former Community Member

Thank you, the 'add file' code that was in the sample (I believe it was your sample and it has been extremely helpful, thank you for posting it) for the button that is not working once distributed is pasted below - is this what is getting overridden in the distribution process, and if so, is there any way to modify to prevent that from happening?

For the other issue of trying to find a way to auto add the image to the list of files is ok if not possible, we will just need to decide whether to distribute the form without the image showing and just collect in the list, or whether to have them insert the image and add to list.

However, the 'add file' button not working once distributed will be a problem, and appreciate any help, thank you.

Untitled.#subform[0].Button1::click - (JavaScript, client)

var myDoc = event.target;

var sFile = "myFile" + NumericField1.rawValue;

myDoc.importDataObject({cName: sFile});

var myDataObject = myDoc.getDataObject(sFile);

var sFileName = myDataObject.path;

ListBox1.addItem(sFileName,sFile);

NumericField1.rawValue = NumericField1.rawValue + 1;

Avatar

Former Community Member

Once it is distributed are the users using Reader or Acrobat? I assume that you are using Acrobat and then distributing it....right?

Paul

Avatar

Former Community Member

I do not know all the variations that will be used.  The predominant should be Reader and Adobe Pro, but sometimes we get other forms returned that have been completed with NitroPDF, XChange PDFViewer, Mac Preview and other variations, but these are rare and exceptions and usually come back with invisible text we have to do some workarounds to capture.  Most will have some version of the Reader or some have Adobe Pro.

Avatar

Former Community Member

Then that is your issue ....Reader does not allow you to add attachments by default. You must Reader Extend the file using LiveCycle Reader Extensions server to allow file attachments. if they are using Acrobat this is not an issue.

Paul

Avatar

Former Community Member

I can see how that could be a problem, and may not be understanding rightly, but unfortunately, I haven't gotten that far as I am only testing on my own machine and do not have Reader installed, only Adobe Pro 9.3.2, and I'm extending the form for Reader when I distribute/test.  All the other buttons and drop-downs, etc., work except the add files button, and am not sure what is wrong with the way I've done the form, as it does work correctly if I don't distribute.  Thank you again.

Avatar

Correct answer by
Former Community Member

Extending with Acrobat does not give you that functionality ...thats why I said you need LiveCycle Reader Extensions server to accomplish this.

Paul

Avatar

Former Community Member

Thank you, I did not have a good understanding, sorry.  Don't have LiveCycle Reader Extensions server so I believe we will need to look for another solution then, unfortunately.  Thank you for your help.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----