Dart Home | PowerTCP WebServer for ActiveX | Custom Development | Reply | PowerTCP WebServer for ActiveX Topics | Forums |
Author | Forum: PowerTCP WebServer for ActiveX Topic: Output graphics stored on the server |
User936 Posts: 12 Member Since: 01/22/01 |
posted February 1, 2001 12:29 PM How can I perform the following ASP using your Webserver Dart control? Response.ContentType = "image/gif" Response.BinaryWrite <binary data string> ---- How do you specify the type of data being written to the body of the response? Right now, all I see that is available using Dart is: Response.Body.Write <binary data string> but this doesn't work. Plus would this work with a variant array? |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted February 1, 2001 12:35 PM I'm not sure how you could do it in ASP since you don't have events, but here's 2 ways to do it in VB: ' Method 1 - Assign file to stream If Request.FileName = "/testgraphics" Then Response.Body.Clear Response.Body.FileName = "c:\pic.jpg" Response.Status = httpOK End If ' Method 2 - Read Bytes into stream and change content type If Request.FileName = "/testgraphics" Then Response.Header.add httpContentType, "image/jpg", True Dim Stream As New DartStream Stream.FileMode = createExisting Stream.FileName = "c:\pic.jpg" Response.Body.Clear Response.Body.Write Stream.ReadString Response.Status = httpOK End If Hope this helps! Tony Priest Dart Tech SUpport |
User936 Posts: 12 Member Since: 01/22/01 |
posted February 1, 2001 2:48 PM I've tried your 2nd example and it works thank you, but can you send text and an image together? Or more than one image? When I try adding more than one image, the second one added overwrites the first. When I try adding text and an image, the binary image gets displayed as a string. I am careful to make sure that when adding the text I use text/html and when adding the image, "image/jpg". |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted February 1, 2001 2:55 PM You're talking about multi-part form data (I think) For that you would have to create a complete structure that contains all the parts and part identifiers. Sorry but I don't have an example of that. Tony |
Reply | PowerTCP WebServer for ActiveX Topics | Forums |
This site is powered by
![]() |