Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting IMG SRC from BinaryStream

Status
Not open for further replies.

KirbyWallace

Programmer
Dec 22, 2008
65
0
0
US
Consider this:



foo.asp opens an ADO binary stream, reads binary data and then uses response.binaryWrite() to write that data to the response stream.

All the prep is done (response.buffer=true, no other extraneous data written to the response output, etc.)

It doesn't work.

But I've seen countless articles and posts on the web describing this exact thing. I can't imagine that they are ALL wrong.

Is it actually possible to load an image source with the output of another ASP or PHP (or whatever) page?
 
Hi

KirbyWallace said:
Is it actually possible to load an image source with the output of another ASP or PHP (or whatever) page?
I do not understand what are you asking there. If you mean both the HTML page and the image embedded in the HTML are generated by server-side scripts, there still will be two requests. You can handle both requests by the same server-side script, but not the same instance : for two requests there will be two script executions.

One workaround is The "data" URL scheme. However it was long ignored as support in Explorer was introduced only in version 8.

If I misunderstood your question, please clarify.


Feherke.
 
If I understand correctly, then yes it is very possible to load an image from a stream into an html image element.

For instance a image that is contained within a database in a blob field can be read and output into an image tag in just such a method.

This of course requires the proper headers to be sent in the foo.xxx page to load the image.

With that said this is a question of how you are attempting to display the image in foo.xxx more than it is an HTML matter.

At the end of the day, calling up foo.xzx should display the image by itself if all is correctly set in the server side code.

If you are having trouble with this, I suggest posting in the forum for the server side language you are using.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top