Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ftp library

20 views
Skip to first unread message

jic

unread,
Apr 6, 2002, 8:55:46 PM4/6/02
to

Hi all!

There are VBScript calls to HTTP/XML librares by using

Set xml = CreateObject("Microsoft.XMLHTTP")

Are there any out there to use as a full FTP client?

thanks,

josé


Alex K. Angelopoulos

unread,
Apr 8, 2002, 12:04:52 AM4/8/02
to
You can use XMLHTTP to do that in most cases. Here's an example of getting a text file via FTP with XMLHTTP; it gets a little more hairy with special types of files, so you might want to mention what you are after.

The following script and embedded function will run from WSH to return and display the specified file; you can convert it to an ASP or IE hosted file by using response.write/document.write instead of wscript.echo.


sXMLData = GetXML("ftp://ftp.microsoft.com/bussys/readme.txt","","")
wscript.echo sXMLData

Function GetXML(sURL,sUsr,sPasswd)
' Create an xmlhttp object:
Dim oXML
Set oXML = CreateObject("Microsoft.XMLHTTP")
' Opens the connection to the remote server.
' rtn = xml.Open((B))
oXML.open "GET",sURL, false,sUsr,sPasswd
' Actually Sends the request and returns the data:
oXML.send
Do:wscript.sleep 10:Loop While oXml.ReadyState<>4
GetXML = oXML.responseText
End Function


"jic" <cab...@wrc.xerox.com> wrote in message news:a8o8v2$pvj$1...@news.wrc.xerox.com...

Alex K. Angelopoulos

unread,
Apr 8, 2002, 6:58:12 PM4/8/02
to
If you want to really use FTP, why not just do a standard FTP session using a script on your client?
I'm not familiar with the details - I don't use the FTP client that much - but there are several examples in the microsoft.public.scripting.wsh and microsoft.public.scripting.vbscript groups in google. You might want to use this as a starting point (I kid you not - this comes up over there at least once a week).

To do a quick browse and see what people have done, go to
http://groups.google.com
and plug in this search:
ftp group:microsoft.public.scripting.*

You will get a LOT of hits.

In case this is the approach you want to take but it is less than obvious how to do some particular things, go ahead and take an initial look for something that *looks* like what you want to do and then do a followup to the "mainline" scripting groups - everyone seems to gravitate to microsoft.public.scripting.vbscript these days... :-)

----- Original Message -----
From: "jic" <cab...@wrc.xerox.com>
Newsgroups: microsoft.public.inetsdk.programming.scripting.vbscript
To: <alexange...@hotmail.com>
Sent: Monday, 2002-04-08 16:18
Subject: Re: ftp library


>
> Thanks Alex. The idea is to fully have the ftp libraries so
> that I can do ftp commands while logged on an ftp server.
> For example: here are the steps that I would like to do:
>
> ftp host.company.com
> name user
> pass password
> dir [do something with the output of dir]
> mput file1 fil2 file3 file4 fileN
> quit
>
> plus others, but this basic example, will help me greatly.
>
> thanks,
>
> josé
>
>
> In article <#ZHFbJr3BHA.2488@tkmsftngp04>,
> alexangelopoulos_at_hotmail_dot_com_remove__ says...


> >
> >You can use XMLHTTP to do that in most cases. Here's an

> example of =


> >getting a text file via FTP with XMLHTTP; it gets a little

> more hairy =


> >with special types of files, so you might want to mention

> what you are =


> >after.
> >
> >The following script and embedded function will run from WSH

> to return =


> >and display the specified file; you can convert it to an ASP

> or IE =


> >hosted file by using response.write/document.write instead

> of =
> >wscript.echo.
> >
> >
> >sXMLData =3D


> GetXML("ftp://ftp.microsoft.com/bussys/readme.txt","","")
> >wscript.echo sXMLData
> >
> >Function GetXML(sURL,sUsr,sPasswd)
> > ' Create an xmlhttp object:
> > Dim oXML

> > Set oXML =3D CreateObject("Microsoft.XMLHTTP")


> > ' Opens the connection to the remote server.

> > ' rtn =3D xml.Open((B))


> > oXML.open "GET",sURL, false,sUsr,sPasswd
> > ' Actually Sends the request and returns the data:
> > oXML.send
> > Do:wscript.sleep 10:Loop While oXml.ReadyState<>4

> > GetXML =3D oXML.responseText
> >End Function
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >=20
> >"jic" <cab...@wrc.xerox.com> wrote in message =
> >news:a8o8v2$pvj$1...@news.wrc.xerox.com...
> >>=20
> >> Hi all!
> >>=20


> >> There are VBScript calls to HTTP/XML librares by using

> >>=20
> >> Set xml =3D CreateObject("Microsoft.XMLHTTP")
> >>=20


> >> Are there any out there to use as a full FTP client?

> >>=20
> >> thanks,
> >>=20
> >> jos=E9
> >>=20
> >>=20
> >
>
>

jic

unread,
Apr 8, 2002, 5:19:35 PM4/8/02
to

Thanks Alex. The idea is to fully have the ftp libraries so
that I can do ftp commands while logged on an ftp server.
For example: here are the steps that I would like to do:

ftp host.company.com
name user
pass password
dir [do something with the output of dir]
mput file1 fil2 file3 file4 fileN
quit

plus others, but this basic example, will help me greatly.

thanks,

josé


In article <#ZHFbJr3BHA.2488@tkmsftngp04>,
alexangelopoulos_at_hotmail_dot_com_remove__ says...
>

>You can use XMLHTTP to do that in most cases. Here's an

example of =


>getting a text file via FTP with XMLHTTP; it gets a little

more hairy =


>with special types of files, so you might want to mention

what you are =


>after.
>
>The following script and embedded function will run from WSH

to return =


>and display the specified file; you can convert it to an ASP

or IE =


>hosted file by using response.write/document.write instead

of =
>wscript.echo.
>
>
>sXMLData =3D

GetXML("ftp://ftp.microsoft.com/bussys/readme.txt","","")
>wscript.echo sXMLData
>
>Function GetXML(sURL,sUsr,sPasswd)
> ' Create an xmlhttp object:
> Dim oXML

> Set oXML =3D CreateObject("Microsoft.XMLHTTP")


> ' Opens the connection to the remote server.

> ' rtn =3D xml.Open((B))


> oXML.open "GET",sURL, false,sUsr,sPasswd
> ' Actually Sends the request and returns the data:
> oXML.send
> Do:wscript.sleep 10:Loop While oXml.ReadyState<>4

> GetXML =3D oXML.responseText
>End Function
>
>
>
>
>
>
>
>
>
>=20
>"jic" <cab...@wrc.xerox.com> wrote in message =
>news:a8o8v2$pvj$1...@news.wrc.xerox.com...
>>=20
>> Hi all!
>>=20

>> There are VBScript calls to HTTP/XML librares by using

>>=20
>> Set xml =3D CreateObject("Microsoft.XMLHTTP")
>>=20

>> Are there any out there to use as a full FTP client?

0 new messages