How can I use vbscript to download a file from web server?
... or should I use other means to do the task? (The web server
is general one.)

TIA
Milos

Re: File download by Roland

Roland
Mon Jul 18 06:31:56 CDT 2005

"Milos Puchta" wrote in message
news:%236cX9w1iFHA.1232@TK2MSFTNGP15.phx.gbl...
: How can I use vbscript to download a file from web server?
: ... or should I use other means to do the task? (The web server
: is general one.)

Since a lot of people get download and upload confused, can you elaborate on
the process you want this script to perform? And, please define if you want
to use vbscript in WSH, HTA or ASP.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp



Re: File download by Milos

Milos
Mon Jul 18 13:42:49 CDT 2005

Roland,

I feed Active Directory by data from text file that I grab from web
destination. While the script for user data works flawlessly, I have
not find any hint, how to grab the data from the web automatically
(Not to say how to find the encrypted connection procedure and
secure authentication. It is not safe at present time, my colleague
displays data in clear text..... :-(( )

TIA
Milos



"Roland Hall" <nobody@nowhere> wrote in message
news:OEo9Ox4iFHA.1044@tk2msftngp13.phx.gbl...
> "Milos Puchta" wrote in message
> news:%236cX9w1iFHA.1232@TK2MSFTNGP15.phx.gbl...
> : How can I use vbscript to download a file from web server?
> : ... or should I use other means to do the task? (The web server
> : is general one.)
>
> Since a lot of people get download and upload confused, can you elaborate
> on
> the process you want this script to perform? And, please define if you
> want
> to use vbscript in WSH, HTA or ASP.
>
> --
> Roland Hall
> /* This information is distributed in the hope that it will be useful, but
> without any warranty; without even the implied warranty of merchantability
> or fitness for a particular purpose. */
> Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
> WSH 5.6 Documentation -
> http://msdn.microsoft.com/downloads/list/webdev.asp
> MSDN Library - http://msdn.microsoft.com/library/default.asp
>
>



Re: File download by Roland

Roland
Mon Jul 18 15:36:00 CDT 2005

"Milos Puchta" wrote in message
news:uRyT2i8iFHA.3472@TK2MSFTNGP10.phx.gbl...
: Roland,
:
: I feed Active Directory by data from text file that I grab from web
: destination. While the script for user data works flawlessly, I have
: not find any hint, how to grab the data from the web automatically
: (Not to say how to find the encrypted connection procedure and
: secure authentication. It is not safe at present time, my colleague
: displays data in clear text..... :-(( )

Milos...

How is the manual process accomplished? You can always use an HTTPRequest
to grab just about anything on the web.
Please respond after my questions, not before.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp



Re: File download by Kreepz86

Kreepz86
Mon Jul 18 21:31:59 CDT 2005

this should work for you.
-------download.vbs-------------------

Option Explicit
'*
Const scrFile = "filedownload.vbs"
Const urlFile = "http://xxx.xxx/file"
Const dlDir = "x:\dir\file"
'*
MsgBox Fetch(urlFile, dlDir), vbInformation, scrFile


Function Fetch(xURL,xOUT)
On Error Resume Next
Err.Clear
Dim b
With CreateObject("Microsoft.XMLHTTP")
.Open "GET",xURL,False
.Send
b = .ResponseBody
If Err.Number <> 0 Or .Status <> 200 Then
Fetch = False
Exit Function
End If
End With
With CreateObject("ADODB.Stream")
.Type = 1
.Open
.Write b
.SaveToFile xOUT,2
End With
Fetch = Err.Number = 0
End Function

-------------end of code----------------------




"Milos Puchta" <mpuchta@. nospam.post.cz> wrote in message
news:%236cX9w1iFHA.1232@TK2MSFTNGP15.phx.gbl...
> How can I use vbscript to download a file from web server?
> ... or should I use other means to do the task? (The web server
> is general one.)
>
> TIA
> Milos
>



Re: File download by Milos

Milos
Thu Aug 04 07:38:35 CDT 2005

Many thanks. This is beyound my expectations.

Just one question: The script works nicely.
However the interpretation of CrLf is perhaps
different and I obtain "long row(s)". Is the resulting
file correct and the interpretation of file by notepad
incorrect... or the opposite is true?

TIA
Milos