On Sun, 16 Oct 2005 01:50:25 -0500, "McKirahan" <Ne**@McKirahan.com>
wrote:
<katrinaVictim@.> wrote in message
news:to********************************@4ax.com.. . Question:
I get the eror listed at the bottom of the post. What can I do to
make the response of the x1.send a "binary" type? Or, in general,
how can I just "make this work"?
<%@ Language=VBScript %>
<%
Response.Buffer = TRUE
Response.ContentType = "image/jpg"
Set x1 = Server.CreateObject("Msxml2.ServerXMLHTTP")
x1.open "GET", "[http link to your favorite image.jpg]", FALSE
x1.send
Response.BinaryWrite x1.responsestream
set x1 = nothing
%>
Error is returned below:
'Response object error 'ASP 0106 : 80020005'
'Type Mismatch
'/scraps/getGraphic.asp, line 10
'An unhandled data type was encountered.
Try xl.ResponseBody
You can read the response using one of four properties.
responseBody
responseStream
responseText
responseXML
http://www.eggheadcafe.com/articles/20010114.asp
ResponseBody Variant array
Returns the body of the response as an array.
ResponseStream IStream
Returns the body of the response as an ADO Stream object.
ResponseText String
Returns the body of the response as a text string.
ResponseXML XMLDocument Object
Returns the body of the response as parsed by the MSXML XMLDOM parser.
http://www.sxlist.com/techref/langua...wwwextract.htm
You're correct. Response.body does return the graphic to the browser
if NO html surrounds the functional code.
I had left in the <html><body>....</body></html> tags around the
VBScript above before I posted to the newsgroup (whoops), and when
doing this the browser then interprets the content as "text". Try
putting in a mere <html> tag before the code and you'll get a bunch of
extended ascii and stuff in the browser when using responseBody.
See, here's my issue. I have graphics that are availabe on an
e-commerce drop ship suppliers web server. There are huge numbers of
them... I can't download them all. I can simply use a <img> tag to
get graphics on my web pages by pointing to their "http://[their
webserver]/[image].gif", but that means that hackers and others can
simply "decompose" my webpages and see that I'm just a downline
supplier to a wholesale distributor. The "domain" of the graphics
location will be different than my domain.
So I wanna transport the graphic to the page by a webserver to
webserver call from my domain. And, I need to be able to give the
ServerXMLHTTP function a dynamic http:// string within the script...
I've already tried server.execute, but I can't use a querystring with
that... I've tried response.contenttype ... I need to be able to get
the link to the graphic from the database then parse it into a string
and dynamically make an http:// call out the their webserver and then
binarywrite it back to the location on the page, intermingling the
graphic stream with other returned html...
I wish this would work.