AFFile.Download Method (String)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Downloads the file from the server to the specified path.
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public string Download( string path )
Public Function Download ( path As String ) As String Dim instance As AFFile Dim path As String Dim returnValue As String returnValue = instance.Download(path)
public: String^ Download( String^ path )
member Download : path : string -> string
Parameters
- path
- Type: SystemString
The path for the file downloaded from the server.
Return Value
Type: StringReturns the full path to the file that was downloaded from the server.
Remarks
If the Owner has been set, then the file is downloaded from the server. If the Owner has not been set, then the buffered file data will be returned.
The portions of the specified path that do not exist will be automatically created. The FileInfo.LastWriteTimeUtc of the created file will be set to the value of the ChangeDate property.
The rules for interpreting the path parameter are as follows:
- If path ends in a DirectorySeparatorChar, then the specified path is assumed to be a directory and the file's Name is automatically appended.
- Else if path exists and is a directory, then the file's Name is automatically appended to the path.
- Else if path exists and is a file, then the file is overwritten.
- Else if path does not exist, then it is assumed to be a file.