Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 19th, 2004, 06:06 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

ok. Here is my code.

Dim xmlHttp
    Set xmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
    Call xmlHttp.open("GET", "http://www.google.co.in/logos/summer2004_weightlifting.gif")
    Call xmlHttp.send()

    Dim stream
    Set stream = Server.CreateObject("ADODB.Stream")
    stream.Type = adTypeBinary
    Call stream.Open()
    Call stream.Write(xmlHttp.responseBody)
    Call stream.SaveToFile(Server.MapPath("..") & "\uploads\google_logo.gif", adSaveCreateOverWrite)
    Call stream.Close()
    Set stream = Nothing

    Set xmlHttp = Nothing

It gives error at this line.

stream.Type = adTypeBinary

The error is:

ADODB.Stream error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/testcode/test3.asp, line 17
 
Old August 19th, 2004, 06:17 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Like I said, you need to reference the ado constants.

If you haven't got them handy, just at this to the top of your file:

Code:
Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2
HTH,

Chris

 
Old August 19th, 2004, 06:39 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

Hello Chris,

This works. Thanks a lot.
 
Old August 19th, 2004, 07:28 AM
Authorized User
 
Join Date: Aug 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks both of you
I got what i want.

~Thanks again





Similar Threads
Thread Thread Starter Forum Replies Last Post
Store and Retrieve Images in SQL Database derekl ASP.NET 1.0 and 1.1 Professional 4 December 19th, 2007 03:16 AM
asp, store, retrieve form value from cookies? kumiko Classic ASP Basics 0 November 24th, 2007 12:33 PM
How to store and retrieve formatted strings in db jessi Classic ASP Professional 2 March 9th, 2007 07:27 AM
How to store image in oracle database and retrieve y.suresh JSP Basics 1 February 28th, 2005 07:01 AM
How do you store and retrieve a hierachy Hubman Pro VB.NET 2002/2003 0 August 4th, 2003 09:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.