Response.WriteBinary problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gunther Schmidl

    Response.WriteBinary problem

    Hi,

    I've rolled my own perl component for resizing pictures on the fly, but I
    have a problem with actually outputting the resized image.

    Here's my code:

    Dim res
    Response.Buffer = true
    Set res = Server.CreateOb ject("ResCom.Re sizer")
    grr = res.ResizeFile( "c:\inetpub\www root\perl\test. jpg", 100)
    Response.Conten tType = "image/jpeg"
    Response.Binary Write(grr)
    Response.Flush

    ....and it appears as a broken image. If I download the web page it creates
    with 'wget', it looks like BinaryWrite is padding every character from the
    string with a hexadecimal 0 (unicode?), thereby doubling the output in size
    and making it unusable. If I use Response.Write, it (naturally) doesn't work
    either.

    I've tried returning a VT_UI1, VT_BSTR or VT_ARRAY from the component, and
    it doesn't make any difference.

    Any recommendations ?

    Thanks,

    Gunther


Working...