Page 1 of 1

LoadFromStream

Posted: Wed Apr 14, 2004 3:48 pm
by 9078764
Hi,

I'm trying to work with LoadFromStream method but it fails.
Does it requires a special data format ?

I'm feeding it with xmlhttp.responseStream. There's no error but no chart either.
Here is the code:
set objXmlHttp = CreateObject("Microsoft.XMLHTTP")
objXmlHttp.open "POST","/Applets/TeeChart/TeeFromWeb.asp?userid=100&teePath=path,false
objXmlHttp.send
objTChart.Import.LoadFromStream objXmlHttp.responseStream
set objXmlHttp = nothing

The thing works only like this:
objTChart.Import.LoadFromURL "http://xx/Applets/TeeChart/TeeFromWeb.a ... ePath=path

The TeeFromWeb.asp successfully reads the tee file as binary data. It returns the data with Response.binaryWrite.

Do I have to convert objXmlHttp.responseStream to some array ? How do I do that in VBScript
and JavaScript ?

Thanks for your help,
Ofer.

Posted: Thu Apr 15, 2004 9:04 am
by Chris
Hi --
The TeeFromWeb.asp successfully reads the tee file as binary data. It returns the data with Response.binaryWrite.

Do I have to convert objXmlHttp.responseStream to some array ? How do I do that in VBScript
and JavaScript ?
Mmm ... have a look at "Getting Binary Data" on:
http://www.4guysfromrolla.com/webtech/110100-1.shtml

Maybe using syntax similar to:

Code: Select all

objTChart.Import.LoadFromStream Response.binaryWrite(objXmlHttp.responseBody)
will work for you ...