Downloading
a file from the Web
Introduction
CAVERNsoft provides classes to download files from Web servers.
CAVERNsoft classes used
CAVERNnet_http_c
This class is used to instantiate a 'webget' object and assign to it the
remote WEB address, path and file using setRemoteSite(),
setRemotePath()
and setRemoteFile()
. Use the setMode()
method to choose between AUTO LOAD, FORCED LOAD or CHECK BUT DONT LOAD.
Finally the actual transfer can be carried out with the grabWEBFile()
method. The getWEBFile() method uses an object of class CAVERNnet_tcpClient_c
to perform the connectToServer() and the I/O operations.
Usage
Run the program with the following
arguments :
webgrab webserver webpath webfilename localpath localfilename
eg:webgrab www.evl.uic.edu spiff/images blazer.gif /netusr/evl/spiff blazer.gif
Output
1. If the file was not present already in the destination then the message
"File grabbed ok!"
will be flashed. Check the destination directory if the file was downloaded.
2. If you try to grab the same file again (and the file was unchanged since
the last grab) then the following mesaage will be displayed:
"File on server is not new. No download attempted".
3. Some other messages may be displayed depending upon the situation (eg.file
not found, cannot connect etc.).
.
for more information email : cavern@evl.uic.edu