Solved

Embedded Objects - Byte streams

Posted on 2004-09-06
7
1,034 Views
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
0
Comment
Question by:jdembare
7 Comments
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 125 total points
Comment Utility
Jay, it is not possible. Stream works on physical file !!

~Hemanth
0
 
LVL 15

Assisted Solution

by:Bozzie4
Bozzie4 earned 125 total points
Comment Utility
It doesn't work in WebQuerySave because you need to allow 'Restricted Operations' on the agent itself, and to the agent signer.

cheers,

Tom
0
 
LVL 19

Expert Comment

by:RanjeetRain
Comment Utility
This is achievable if this is only for Web and if being designed for Internet Explorer.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 15

Expert Comment

by:Bozzie4
Comment Utility
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 )

cheers,

Tom
0
 

Author Comment

by:jdembare
Comment Utility
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.

cheers
Jay
0
 
LVL 15

Expert Comment

by:Bozzie4
Comment Utility
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 ....)

cheers,

Tom
0
 
LVL 19

Expert Comment

by:RanjeetRain
Comment Utility
Tom, I had something else on my mind. Good thing, Jay has sorted it out.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now