So if you are able to send a Base64 encoded version to a rich text field and you want to display it via a browser then you have a couple of things to do.
- Make sure that you are creating your document using MIME.
- Create a MIME entity for the attachment.
- Populate the MIME entity with the Base64 string.
- Decode it into a regular file attachment on the document.
This will give you a regular Domino document with an attachment that you can create a URL and to link to.
This is essentially what the linked example code is doing. Namely:
session.ConvertMime=False
...
Set child = parent.CreateChildEntity()
Set header = child.CreateHeader("Content-Disposition")
Call header.SetHeaderVal({attachment; filename="} & fileName & {"})
...
Call child.SetContentFromText(stream, "image/jpeg", ENC_BASE64)
Call child.DecodeContent()
Once you have saved the document then it is trivial to arrange a link to the attachment url with something like db.nsf/viewname/dockey/$file/filename.jpg
or put the url in an img src parameter.
Not having a set up to play with at the moment it's a little difficult to test. I also suspect it would be better if you could mimic a regular file upload from the client. In that case you would not need to mess about with Base64 and MIME with the 1.3x expansion over the wire that gives.