Shiny Language Reference

Language Reference > Web Functions


webdlfile

bool webdlfile(string URL, string Dest);

 

 

Downloads a binary file via HTTP

The WEBDLFILE downloads a binary file via HTTP. The file is downloaded immediately upon executing this statement. The file is transferred in binary mode. This statement is primarily intended for downloading images from websites, although any valid resource can be downloaded. No prior setup, configuration or variable of type WEB is required to use WEBDLFILE.

All caveats and warnings listed for WOPEN apply here.

 

Parameters

URL

A string specifying the binary file to download. This string must be prefixed with the "http://" protocol specifier.

Dest

The full path and filename of the location to save the downloaded file.

 

Return Value

TRUE if downloading succeeded, otherwise FALSE.

 

Example Code

if(webdlfile("http://www.amazingbrass.co.uk/img/brasslogo.gif", "C:\\logo.gif") == TRUE)
{
    image Logo;
    createimage(Logo, "C:\\logo.gif");
}