homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

Downloading files using asp

 10:49 pm on Aug 17, 2003 (gmt 0)


I use the following code in order for my clients to have access in my files without viewing the complete url.
Function getBinaryFile(fileSpec)
Dim adTypeBinary
adTypeBinary = 1
Dim oStream
set oStream = Server.Createobject("ADODB.Stream")
oStream.Type = adTypeBinary
oStream.LoadFromFile fileSpec
getBinaryFile = oStream.Read
set oStream = Nothing
End Function
strFullURL = "the url"
strFileName = Request.QueryString("name")
Response.ContentType = "application/x-unknown"
Response.AddHeader "Content-Disposition","attachment; filename=" & chr(34) & strFileName & chr(34)
Response.BinaryWrite getBinaryFile(strFullURL & strFileName)
However when I put the files on a different server than the one where the site resides, the script can't work and I get an error message which says that the IE can't find the web page. I noticed also that can't recognize the file format also as in the case when the files are in my server.

Any ideas?
Thanks for your attention




 5:40 pm on Aug 19, 2003 (gmt 0)

If I understand, you want to display pages without the user knowing the url?

To do this, you can use the m/s xml component:

function getURI( byval strURI )
dim objXMLParser
set objXMLParser = server.CreateObject("Microsoft.XMLHTTP")
objXMLParser.open "GET", strURI, false
getURI = objXMLParser.responseText
end function


 7:08 pm on Aug 19, 2003 (gmt 0)

Thanks for the answer..
The hiding of the url is one part of my question.
The other is how to achieve to make the downloading of the files which reside in another server and not in mine, available..

However I am interested in your solution about the xml component..

Could you give me an example using this component with a hypothetical url..

Sorry for asking this but I am not an ASP expert..:-)

Waiting for your answer..

Thanks in advance..


too much information

 7:58 pm on Aug 19, 2003 (gmt 0)

Hey dimoss,

why don't you put that file on the other server as well and call it from your main server. That way you can feed the results into your current page and then handle them like a string.


 11:07 pm on Aug 19, 2003 (gmt 0)

Response.Write GetURI (strPage)


 10:03 am on Aug 20, 2003 (gmt 0)


I tried to put the file on the other server but it didn't worked either..

Thanks for the reply aspdaddy..:-)


Global Options:
 top home search open messages active posts  

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved