Creating HTML IMG tag on Notes Client for Attached File?

Hi everyone, I hope someone can help.

I have a form accessed via Notes Client where a user attaches image files with a Rich Text Lite field. Lower down on the form, I have a computed value that is pass thru HTML and I want to display the attached image file in the HTML with an IMG tag.

I’m not sure if this is possible. Basically, the question is, what would the value of the SRC attribute be set to?

Has anyone ever done something like this?

Subject: creating HTML IMG tag on Notes Client for Attached File?

SRC=‘/path/database.nsf/view/documentkeyorunid/$FILE/NameOfAttachment.ext’

You can get the name of the attachment from @AttachmentNames, however if your form has mulitple attachments, you have to be able to find the correct one…

Jeremy

http://www.zetaone.com/jeremy/hodgebloge.nsf

Subject: RE: creating HTML IMG tag on Notes Client for Attached File?

Thanks Jeremy, but this needs to work in Notes Client. The syntax you specified is, I believe, web only.

Subject: RE: creating HTML IMG tag on Notes Client for Attached File?

No, works just fine, e.g. in a computed text as pass-through HTML, as long as @AttachmentNames returns the correct result.

Subject: RE: creating HTML IMG tag on Notes Client for Attached File?

Thanks Harkpabst,

I’ve just tried and it doesn’t seem to work for me though. Here is the code in my computed text (which is set as pass-thru HTML):

list := @AttachmentNames;

pre := “<img src="/” + @WebDbName + “/vwAllByUnid/” + @Text(@DocumentUniqueID) + “/$FILE/”;

@If(list = “” ; “”;@Implode(pre + list + “.ext">”;“”))

  • vwAllByUnid is a view in the database

  • There is a rich text field on the form where I have attached a couple of imags.

The only thing displayed is the little red box with the X in it.

Any ideas?

Subject: RE: creating HTML IMG tag on Notes Client for Attached File?

I think the problem lies in this:

@Implode(pre + list + “.ext">”;“”)

You need to drop the “.ext” out of the code, as the file extension should already be included in the @AttachmentNames … I was just using the “.ext” to illustrate the extension being there.

Try this:

list := @AttachmentNames;

pre := “<img src="/” + @WebDbName + “/vwAllByUnid/” + @Text(@DocumentUniqueID) + “/$FILE/”;

@If(list = “” ; “”;@Implode(pre + list + “">”;“”))

jeremy

http://www.zetaone.com/jeremy/hodgebloge.nsf

Subject: RE: creating HTML IMG tag on Notes Client for Attached File?

Plus you can always use a non-pass-through HTML computed text using the same formula to have a look at what HTML has been generated.

Subject: RE: creating HTML IMG tag on Notes Client for Attached File?

Hey Jeremy,Ya, I realized after my last post that you may have put .ext in there just to mean file extension. So I tried it and checked the output to make sure. I still only get the red box with the X in it. For instance, if I have an image called icon.gif and I insert it into a rich text field on the form, the html should look like this:

where UNID is actually the unid of the document.

But that html does not work for me…

Oh well, it doesn’t matter now because the client didn’t care about the images showing anyway:)

Subject: RE: creating HTML IMG tag on Notes Client for Attached File?

I have a similar problem with the img tag. If i use the following tag: i get the red X in the form.When i put the the url “http://servername/web/database.nsf/Pictures/CFOE-7BJBT5/$File/tn_CFOE-7BJBT5.jpg” in the address-field in the top of the notesclient and press enter, the picture loads successfully. After that, the pictures loads successfull in the form too!

It looks like the form has problems in loading the picture.

Has someone similar problems or a solution to my problem?

Thanx

Subject: RE: creating HTML IMG tag on Notes Client for Attached File?

It wasn’t mentioned in this thread, I think: Do you happen to have the database property to display images after loading checked?

Subject: RE: creating HTML IMG tag on Notes Client for Attached File?

Thank you for your fast response!I have set the option “display images after loading”, same problem.

Something i have not relized before: in the statusbar on bottom notes shows “Image or Object not found on the server”. But the image is there! I can load the image on entering the url in the address field above, like i said before. After loading the image over the address field, the image shows correctly in the form. …strange…

Subject: Double post, please ignore

No, it is not my trembling forefinger posting everything twice today. This forum is soooo damn slow today, again …

Subject: RE: creating HTML IMG tag on Notes Client for Attached File?

Well, if anything, the database property I mentioned would rather cause similar problems, not cure them.

Do you connect to the internet via a proxy server? If so, have a look at the proxy configuration in your location document. Is your domino sever’s host name in the exceptions field? I did notice, that e.g. our proxy server sometimes thinks, that authentication would be required for certain pages. Then, if the very same url is requested again, everything is fine. So, it could be important to make sure that you are not accessing a local Domino server through a proxy, if there’s no need to.

Subject: RE: creating HTML IMG tag on Notes Client for Attached File?

Solved!I removed the proxy server and boom there we go!

Thank you Harkpabst Meliantrop!

Putting the servername into the proxy exclusion-list does not work, will look further on that because i need the proxy. Only removing the proxy definition does it.

Subject: RE: creating HTML IMG tag on Notes Client for Attached File?

Just in case, remember, to not put the server’s Notes name in the exclusion list, but the (internet) host name. Still possible, that Notes doesn’t treat it like it should.

Viel Spaß beim frickeln.

Subject: RE: creating HTML IMG tag on Notes Client for Attached File?

Just on the off chance, the HTTP task is running on the domino server right? And i didn’t think about it before, but not being a web form, I’m not sure that the relative path would work, you might have had to specify the http://www.yourdomain.com/ as well …

jeremy

http://www.zetaone.com/jeremy/hodgebloge.nsf