Serving JPEG from HandleURL

I have a memory block mbReply with JPEG data in it. I am trying to respond to a browser request for the JPEG using the following code in a HandleURL event.

Request.MIMEType = "image/jpeg" dim bsReply as new BinaryStream(mbReply) Request.Print bsReply.Read(bsReply.Length)

I think I may have missed a step because the jpeg doesn’t display in the browser. I tried using the memory block directly with the Request.Print but that didn’t work either.

Any ideas?

Thanks…

Are you returning True?

Would you believe the problem was the bitmap was the same colour as the background? Doh!

But in my travels I found out Print also works with a Classic memory block as well as Picture.Data.

Just to throw it out there for anyone who views this in the future, as not to cause confusion since you mentioned bitmap:

In current and previous versions of Xojo:
*BMP, GIF, & TIFF are not supported by web/console apps using Pictute.GetData.

Picture.Data, will yield a “This item does not exist” error if you try to use it :slight_smile: