Discussion:
Get File from FTP Server - ServerXMLHTTP
(too old to reply)
SPRFRKR
2007-01-03 00:40:05 UTC
Permalink
<%
Response.Buffer = True
Set objHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
'objHTTP.open "GET","ftp://xxx.xxx.xx.xxx/xxx.mp3", false, "username",
"password"
objHTTP.open "GET","ftp://username:***@xxx.xxx.xx.xxx/xxx.mp3",
false
objHTTP.send

Response.ContentType = "application/octet-stream"
Response.BinaryWrite ObjHTTP.responseBody
%>

Any ideas why the above code does not let me access the file on the FTP
server? Neither method to authentcate seems to work. Also tried "OPEN"
but I don't think that worked either.

Thanks!
Jon Paal
2007-01-03 04:51:56 UTC
Permalink
Why would you think that it is allowed to mix http and ftp protocols ?
Post by SPRFRKR
<%
Response.Buffer = True
Set objHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
'objHTTP.open "GET","ftp://xxx.xxx.xx.xxx/xxx.mp3", false, "username",
"password"
false
objHTTP.send
Response.ContentType = "application/octet-stream"
Response.BinaryWrite ObjHTTP.responseBody
%>
Any ideas why the above code does not let me access the file on the FTP
server? Neither method to authentcate seems to work. Also tried "OPEN"
but I don't think that worked either.
Thanks!
Anthony Jones
2007-01-03 15:20:05 UTC
Permalink
Post by Jon Paal
Why would you think that it is allowed to mix http and ftp protocols ?
Because this sort of thing would work using MSXML2.XMLHTTP object.
Jon Paal
2007-01-03 16:25:36 UTC
Permalink
you can't mix protocols.
Post by Anthony Jones
Post by Jon Paal
Why would you think that it is allowed to mix http and ftp protocols ?
Because this sort of thing would work using MSXML2.XMLHTTP object.
Anthony Jones
2007-01-03 16:53:27 UTC
Permalink
Post by Jon Paal
Post by Anthony Jones
Post by Jon Paal
Why would you think that it is allowed to mix http and ftp protocols ?
Because this sort of thing would work using MSXML2.XMLHTTP object.
you can't mix protocols.
What do you mean by 'mix protocols'?

Anthony Jones
2007-01-03 15:17:09 UTC
Permalink
Post by SPRFRKR
<%
Response.Buffer = True
Set objHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
'objHTTP.open "GET","ftp://xxx.xxx.xx.xxx/xxx.mp3", false, "username",
"password"
false
objHTTP.send
Response.ContentType = "application/octet-stream"
Response.BinaryWrite ObjHTTP.responseBody
%>
Any ideas why the above code does not let me access the file on the FTP
server? Neither method to authentcate seems to work. Also tried "OPEN"
but I don't think that worked either.
ServerXMLHTTP being based on WinHTTP is limited strictly to HTTP protocol
(and HTTPS) only.
Post by SPRFRKR
Thanks!
Loading...