Import JPEG (yet again) ;o)

Hi all

I have done a search in the forums and basically found 2 options (well, 3 actually ;o)

  1. use the front end

  2. use Rod’s (Whiteley) code found here: http://www-10.lotus.com/ldd/46dom.nsf/DateAllThreadedWeb/564E5F7E34EB52E880256CEC0064759F?OpenDocument&login

  3. use the Midas stuff

I would REALLY like to use option 2 as it works perfectly if you call it once from a routine (i.e. start your code, import one file, stop your code) but hangs the notes client / server (I assume - server not tested) when you loop.

I have flown ower the code and found that the error occurs when the OSMemory Unlock is called the second time.

Rod - do you know about this problem? Could you take a look at it for me (us) and perhaps correct it?

Thanking you in advance

Ursus

ps: option one cannot be used as this should be done on the server, option 3 is just to plain expensive ;o)

Subject: How about using MIME?

’ DeclarationsDim session as New NotesSession

Dim doc as NotesDocument

Dim jpeg as NotesMIMEEntity

Dim stream as NotesStream

’ Disable MIME conversion

session.ConvertMIME=False

’ Get doc

set doc=session.DocumentContext

’ Import JPEG Image

set jpeg=doc.CreateMIMEEntity(“JPEG”)

set stream=session.CreateStream()

if (stream.open(“c:\path\to\jpegfile.jpg”,“binary”)) then

if (stream.Bytes>0) then

jpeg.setContentFromBytes stream, "image/jpeg", ENC_IDENTITY_BINARY

end if

end if

’ Clean up

stream.close

doc.save true,false

session.ConvertMIME=true

Subject: RE: How about using MIME?

HI Bram

I used your code and it works perfectly ;o)

I don’t really know too much about MIME - will need to take a closer look at it so that I know what I am doing.

Thank you for your help

Ursus

Subject: If you need a tool, take a look at “Import Images 2 Lotus Notes” …

Check out the homepage of Import Image 2 Lotus Notes …

It can import almost any image type “walking on earth” :slight_smile: