Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stream.write fileserver references.

Status
Not open for further replies.

travisbrown

Technical User
Dec 31, 2001
1,016
I'd built a little application for a client that spools selected files to another server using an xmlhttp request.

Originally they'd provided an environment with links to files and everything was working fine. Now for production they suddenly pull out fileserver references that of course break everything.

These docs are called from the fileserver as such:

ViewByDocument.do?guid={111EC1D0-D69F-4F76-9D5C-C484C93CAD6A}

And cause this error:

ADODB.Stream error '800a0bbc'
Write to file failed.

on this line:
Call stream.Write(xmlHttp.responseBody)

I need an alternative method in a hurry. Any suggestions?


Code:
FUNCTION StreamFile(path,target,files)
DIM arr_files()
iteration = 0
	FOR EACH file IN files
		filename = GetFileName(file)
		Dim xmlHttp
		Set xmlHttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
		Call xmlHttp.open("GET", path)
		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(target & "\" & filename, 
adSaveCreateOverWrite)
		Call stream.Close()
		Set stream = Nothing
				
		Set xmlHttp = Nothing
		REDIM PRESERVE arr_files(iteration)
		arr_files(iteration) = filename
		iteration = iteration + 1
	NEXT
	StreamFile = arr_files
END FUNCTION
 
Can you verify the value of xmlHttp.responseBody?
 
Hmm. I don't know what value to verify. If I add

response.write xmlHttp.responseBody before the stream.write, I get for a physical PDF file:

Code:
????????????????????????????????'‰????????????4?????????????????????????????????????????????????????4????????????????????‰????????????4'‰?????8????????????`‰?????????????????????????`‰??????????????????????????????????????????? ???????????????????????‰?????????????????????4????????????????????????????????‰??????????????????????????????????????????????????????????????????????????????????4?‰?????‰??/???????????????????????????????????????????????

Are you hinting that I parse and reject the fileserver links?

I still need to somehow get the files from the FileNet server to the local server.

What the app does is copy a bunch of PDF files from various locations (based on user selection), stitch them together using Persits ASPPDF, then deliver a consolidated file. Or that's what it's supposed to do.
 
And for a FileNet PDF, I get a similar response.

Code:
???????????????????????????????????????????????????ÿ??????????????????????????????'????????????????????P???????????????7????????????????????????????????????????????????B????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????u????????????????¶????????????????????????????????????????????›y????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????/???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????4?â????????â??????ââ?'??????????????????â??????????????????????????????????ââ?????????â?????????????????????????????????????????????????????????????????????????????????o????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????4?â???????`â??????ââ?'?????????â???????????????????????????â?â????â??'ãâ??????????????â??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????â?????????????????????????????????????????????â??????????????????????????????????????????????????????????????????????????????????????????????ââ??????????????????????????????????????????????????????????4?????â???????????????????????????â????????´???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top