$File and RichText Item

Hello,

In a database, we use a form which contains 2 RichText items.

Users access to this form by web.

When a user writes a long text in a RichText item, Domino creates a $File field which is a pointer, and text isn’t contained in the RichTextItem. It works very well.

So, when user writes a long text in both richtext items, Domino creates 2 $File field.

But it seems that Domino, when it saves the document, creates the 2 $File fields but confuses them because some text of the second richtext field is in the first. And the first and the second richtext items have the same text…

???

Someone has any idea on this issue ?

Thanks

Subject: $File and RichText Item

I do a great deal of work with rich text fields and have never seen anything like this. How are you creating the rich text? Are the rich text fields set to save as MIME, perhaps, which would make the $File logic make more sense?

Subject: RE: $File and RichText Item

Yes, I’m sorry. I forgot to specify it.Rich text Fields set to save as Mime.

Subject: RE: $File and RichText Item

The “store contents as HTML and MIME” field property doesn’t really matter when the field is updated from the web. When you use one of the web rich text editors (field marked as “display using best fit for OS” or “display using java applet”) the posted content is text/html the web server creates (or changes) the item to type mime.

Subject: Seems like a bug

As you point out, when the size of a mime item is greater than what will fit in a notes rich text item, it is placed in a $FILE object.The name of the $FILE object is generated from a timestamp.

If the two Rich Text items get saved within the granularity of the timestamp, the $FILE objects have a duplicate name.

Subject: RE: Seems like a bug

Have you got the same problem?Do you really think it’s a bug?

It’s an automatic generation (the name of the $File object) ? There is no way to param it ?

Anyway, thanks for your answer !

Subject: RE: Seems like a bug

I tried an experiment based on your description and observed the same thing you did.Sometimes it works and sometimes it doesn’t.

Yes the name is generated automatically and there is no way to change it.

You could try using attachments for large amounts of data, or two separate forms, or maybe process with a webquerysave agent, but the damage may have already been done before the WQS agent runs.

I have filed a bug report.

If this is an issue for you, you should contact support.

Subject: Ouch - Re:Seems like a bug

I just ran into a similar problem with duplicate $File items being created with mime (6.5.5FP2). The fact that the filenames aren’t unique is causing a big problem.

I’m adding two simple fields to a doc, each with MIME content holding one image.

Dim sess as New NotesSession

Dim db as NotesDatabase

Dim tmpStream as NotesStream

Dim tmpMIMEEntity As NotesMimeEntity

Set db = sess.CurrentDatabase

Dim destDoc as New NotesDocument(db)

Set tmpStream = sess.CreateStream

Call tmpStream.Open(“c:\image1.jpg”)

Set tmpMIMEEntity = destDoc.CreateMIMEEntity(“field1”)

Call tmpMIMEEntity.SetContentFromBytes(tmpStream, “image/jpeg”, ENC_IDENTITY_BINARY)

Call tmpStream.Close

Set tmpStream = sess.CreateStream

Call tmpStream.Open(“c:\image2.jpg”)

Set tmpMIMEEntity = destDoc.CreateMIMEEntity(“field2”)

Call tmpMIMEEntity.SetContentFromBytes(tmpStream, “image/jpeg”, ENC_IDENTITY_BINARY)

Call tmpStream.Close

Call destDoc.Save(False, False)

If the two images are < 40K , then the fields themselves will hold the MIME content and everything works great.

If they are each > 40K then 2 $File items will be created, each with a filename of “mime”. <— The duplicate filenames are the problem.

The two fields (field1 & field2) will both refer to “mime” as their pointer to the $File field. Showing those items as RT fields on a form will then cause both fields to show the same image.

I’ve opened a PMR with Lotus Support about this. I’ll post an update when I have one.

Subject: RE: Ouch - Re:Seems like a bug

Reproduced, SPR: # KCAR6ZSQU6

For now, the workaround is to keep your MIMEEntities small if you have more than one.

I would think that it would be fairly convenient if the $File item was named according to the Content-ID header (if present), as that would let you easily pull apart attachments, etc. But hopefully they’ll fix this to at least go with mime001, mime002, etc.

Subject: RE: Ouch - Re:Seems like a bug

Please let me know if there is a solution to this as I am having the same problem. I have 5 richtextfield displaying mime and all the content gets muddled up