Embedded Objects - Byte streams

Posted on 2004-09-06
Medium Priority
Last Modified: 2013-12-18
I have an embedded image on a form. How can I access the the content as a byte stream without explicitly extracting to disk first? I can pick up the attached object successfully and need a byte stream of that image-object. Code below my give an idea of what I am trying to do:

Dim s as new NotesSession
Dim stream As NotesStream
Dim object As NotesEmbeddedObject

Set stream = s.CreateStream
Set doc = ws.CurrentDocument.Document
If doc.HasEmbedded Then
      Set object = doc.GetAttachment( "myImage.jpg" )
      Call object.ExtractFile( <path> )  // Don't want to do this - besides, didn't work if run on "WebQuerySave" routine no idea why.
//basically trying to end with a stream of bytes here of myImage.jpg
      If Not stream.Open(<path>) Then
            Messagebox stream.Bytes
      End If
End If
Thx Jay
Question by:jdembare
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 24

Accepted Solution

HemanthaKumar earned 500 total points
ID: 11990561
Jay, it is not possible. Stream works on physical file !!

LVL 15

Assisted Solution

Bozzie4 earned 500 total points
ID: 11992118
It doesn't work in WebQuerySave because you need to allow 'Restricted Operations' on the agent itself, and to the agent signer.


LVL 19

Expert Comment

ID: 11993452
This is achievable if this is only for Web and if being designed for Internet Explorer.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 15

Expert Comment

ID: 11994025
Well, Ranjeet, that's only correct if you want to extract to a local machine.

You can't extract the image/file to the local machine (the client) , but you can extract it to a path on the server (if you have appropriate rights in Notes ('restricted operations') and (for the user under which Domino runs) on the OS )



Author Comment

ID: 11995324
Thanks guys for the comments. Well, using both ~Hemanth and Tom I think I can manage a workaround.

But Tom, in your last comment, is this  the case when running off the server?  I have tested my code but running off local and it did extract it. Either way I think I get the gist just curious - actually will try it myself.

LVL 15

Expert Comment

ID: 11995971
Well, on local the restrictions of the server don't apply, naturally.  You can run all agents on local, normally - so you really should test your agents on a server.

You can extract images to the local drive if you run the agent locally, but if you have a web agent, you can't - the web agent can only save to a local folder.  You could give your server access to the fileserver your users use too, but I wouldn't do it...

The notesstream class is btw easier to use then the old ways (especially in manipulating text files, I 've found it way easier than the old Input ....)


LVL 19

Expert Comment

ID: 11996683
Tom, I had something else on my mind. Good thing, Jay has sorted it out.

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question