This method retrieves a file from the specified URL.
This method was introduced with the release of HotDocs 2005.
void RetrieveUrlFile ( string url, ref string FileName )
Parameters | Description |
url | The URL of the file to retrieve. |
FileName | The file name of the file to retrieve.
If the file is not already in the Internet Explorer cache, HotDocs will save the downloaded file in the location specified in this parameter. If the file is in the cache, however, the value returned in this parameter will be the location of the file in the cache. |
The following Visual C# example downloads a file from a Web site and saves it on the local hard drive:
public class ExampleCode { static void Main() { HotDocs.Application app = new HotDocs.Application(); string url = "http://www.hotdocs.com/sites/default/files/logo_4.png"; string FileNameDestination = @"C:\temp\image.jpg"; string FileName = FileNameDestination; app.RetrieveUrlFile(url, ref FileName); // If the file was already in the Internet Explorer cache, FileName will not be the same value as it was originally. // In that case, copy the file from the cache to the desired location. if (FileName != FileNameDestination) System.IO.File.Copy(FileName, FileNameDestination, true); } }