IronWebScraper - The C# Web Scraping Library
WebScraperDownloadFile Method (Uri, 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)

public virtual string DownloadFile( Uri uri, string path, bool overWrite = false, HttpIdentity identity = null )
Public Overridable Function DownloadFile ( uri As Uri, path As String, Optional overWrite As Boolean = false, Optional identity As HttpIdentity = Nothing ) As String
Parameters
- uri
- Type: SystemUri
The absolute uri 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: StringThe file path (relative to WorkingDirecory) which the file will be saved to.
