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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Multiple Binary Files to a browser with no Usr Intervention

Status
Not open for further replies.

TrekFan

Programmer
Apr 23, 2003
25
CR
Hi there,

I'm trying to send multiple files from the server to a browser without any user intervention to a default path on the client's machine.

This is using vbscript on asp.

To do this, I'm trying to use an xml object and using the ado.stream object, put each file in a different node and send it back as a binary response back to the client

But … i'm getting back this error:

Error Type:
Response object, ASP 0185 (0x80020003)A default property was not found for the object.

To track the error i simplified the code and i'm just sending the filename to see what the error is ... the code is :


<%@ LANGUAGE=VBScript%>
<% Option Explicit

Dim objStream
Dim xml_dom
Dim l_node1

set xml_dom = CreateObject(&quot;MSXML2.DOMDocument&quot;)
xml_dom.loadXML(&quot;<?xml version='1.0' ?> <root/>&quot;)
xml_dom.documentElement.setAttribute &quot;xmlns:dt&quot;, &quot;urn:schemas-microsoft-com:datatypes&quot;

set l_node1 = xml_dom.createElement(&quot;Filename&quot;)
l_node1.text = &quot;MyFile&quot;
xml_dom.documentElement.appendChild l_node1

Response.ContentType = &quot;binary/octet-stream&quot;
Response.BinaryWrite xml_dom

set xml_dom = nothing
set l_node1 = nothing


%>


Thanks for your help !!!!!!!!!!!!!









 
Which line is the error occuring on?

[sub]01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111[/sub]
The never-completed website:
 
Hi Tarwn ,

Ups ! You are correct .. i didn't mention this on the post ... it is on the statement :

Response.BinaryWrite xml_dom

Thanks !

TrekFan
 
Found out what the problem was :

Found out the problem ...

It has to be :

Response.ContentType = &quot;application/octet-stream&quot;
Response.Write xml_dom.xml


And it works fine !!


Thanks !
 
On the note of XML... where can I read up about how to treat XML file like database?

Earnie Eng
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top