WebScraper.DownloadFile Method (String, String, Boolean, HttpIdentity)

IronWebScraper

WebScraperDownloadFile Method (String, String, Boolean, HttpIdentity)

Requests a file to be downloaded from the given Url to the local file-system. Often used for scraping documents, assets and images.

Normally called with an Parse Method of IronWebScraper.WebScraper

Namespace:  IronWebScraper
Assembly:  IronWebScraper (in IronWebScraper.dll) Version: 4.0.4.25470 (4.0.4.3)
Syntax
public virtual string DownloadFile(
	string url,
	string path,
	bool overWrite = false,
	HttpIdentity identity = null
)
Public Overridable Function DownloadFile ( 
	url As String,
	path As String,
	Optional overWrite As Boolean = false,
	Optional identity As HttpIdentity = Nothing
) As String

Parameters

url
Type: SystemString
The absolute url of the resource to be downloaded.
path
Type: SystemString
The path to which the downloaded file should be saved. You may give a directory name or a file name.

Relative paths will be resolved relative to WorkingDirectory.

overWrite (Optional)
Type: SystemBoolean
If set to true any existing file at the given path will be overwritten. If set to false a unique name such as "file(1).html" will be created in the case of a naming conflict.
identity (Optional)
Type: IronWebScraperHttpIdentity
An HttpIdentity to send the Request. If null, the ChooseIdentityForRequest method will be used to find a suitable identity.

Return Value

Type: String
The file path (relative to WorkingDirecory) which the file will be saved to.
See Also