READ_URL@

Platform

Win32, x64

Purpose

To to read the contents of a URL.

Syntax

SUBROUTINE READ_URL@(URL, FILE, MODE, ERROR)
CHARACTER(*) URL, FILE
INTEGER MODE, ERROR

Description

If this routine succeeds (i.e. an internet connection is available and the URL can be accessed), ERROR is set to zero and the data from the URL is transferred to the specified file (which can be a full path name). If MODE=0, the data is assumed to be text and new lines are converted to DOS style. If MODE=1, binary data is assumed.

The URL can be quite general. In particular, you can use an FTP address assuming anonymous access is possible, or an HTTP address with extra information attached. For example, you could query a search engine directly using this routine.

If you want more control over how the download is controlled you can set a callback for this routine. The callback will be called at a point in the download process at which you can configure the connection. The callback is set via:

SUBROUTINE SET_INTERNET_CB@(cb)
INTEGER,EXTERNAL::cb

When your callback is called you can use SET_INTERNET_PARAM@ to configure the connection. If the callback function returns zero then the primary internet call is aborted.

INTEGER FUNCTION SET_INTERNET_PARAM@(PARAM, VALUE)
INTEGER PARAM,VALUE

PARAM is one of the option flags listed here: https://docs.microsoft.com/en-us/windows/win32/wininet/option-flags. SET_INTERNET_PARAM@ returns the previous value for the given parameter. If VALUE is set to zero then the existing value is returned without setting a new value.

See also

DOWNLOAD@, Linking to the web

 

 

Basket
Empty
 
Copyright © 1999-2020 Silverfrost Limited