The Download method performs the download processing to return a file from the server as a string.
Namespace – ABSuite.AccessLayer.Connector.Core
Assembly – Unisys.ABSuite.AccessLayer.Connector.Core (in Unisys.ABSuite.AccessLayer.Connector.Core.dll)
Syntax
string Download( string virtualPath, string targetFolder = null )
Argument
virtualPath – System.String
This argument provides the path and filename of a specific file on the server.
targetFolder – System.String
This argument is optional. It specifies the path where the file is downloaded. If this argument is null the file is downloaded to the File Repository Local folder.
Return Value
This method returns a string containing the location of the downloaded file or data.
Using the IFileRepositoryService Interface for the Download Method
The following code is an example of using the Download() method:
// Declare the FileRepositoryService IFileRepositoryService fileRepos = FileRepositoryServiceFactory.Create(); // Specify the connection details for the repository access FileRepositoryConnectionDetails fDetails = new FileRepositoryConnectionDetails(); fDetails.FileRepositoryDirectory = "\\\\au-papachj-5\\classes\\FREPOS"; // Connect to the File Repository Service fileRepos.Connect(fDetails); // Download an image which returns a byte array that can be stored as a file in a local directory. var file = fileRepos.Download("Images\\JP.JPG");