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.