PBM: ADOStream.Write( Request.BinaryRead() ) causes an error

Discussion in 'ASP General' started by Vince C., Apr 4, 2004.

  1. Vince C.

    Vince C. Guest

    Hi.

    I'm trying to put upload results from an HTML form into an ADO stream. I thought
    I could code the following (JavaScript):

    var s = Server.CreateObject("ADODB.Stream");
    s.Type = adTypeBinary;
    s.Open();
    s.Write( Request.BinaryRead() )

    but it doesn't work and I get an error "Arguments of wrong type". IIS doc says
    BinaryRead() returns an array of bytes. It also says that ADOStream.Write takes
    an argument of type array of bytes... So what are the types that are so wrong
    that I get such an error?

    Is there a way to put directly the received array of bytes into an ADO stream?

    Thanks for any hint/suggestion,
    Vince C.
     
    Vince C., Apr 4, 2004
    #1
    1. Advertising

  2. Vince C.

    Vince C. Guest

    Re: ADOStream.Write( Request.BinaryRead() ) causes an error

    Posted too quickly...

    s.Write( Request.BinaryRead(Request.TotalBytes) )

    is far, far better :)

    Vince C.

    ------

    "Vince C." <> a écrit dans le message de
    news:...
    [...]
    > s.Write( Request.BinaryRead() )

    [...]
     
    Vince C., Apr 4, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Birtle
    Replies:
    2
    Views:
    2,192
    John Saunders
    Oct 16, 2003
  2. Nikhil
    Replies:
    1
    Views:
    200
    GVaught
    Sep 11, 2003
  3. Roberto
    Replies:
    1
    Views:
    162
  4. P Cooper

    Request.BinaryRead ASP error

    P Cooper, Jan 6, 2005, in forum: ASP General
    Replies:
    1
    Views:
    310
    P Cooper
    Jan 6, 2005
  5. Replies:
    0
    Views:
    368
Loading...

Share This Page