Item.fetchFileProperty()
Copy
The function fetchFileProperty()takes in 3 parameters; property, file path, and mode. It returns Item of type File.
- Property – The property of type file for which you want to download the file
Target path – The file path on the file system where to place the file
A file name can be specified as to change the name of the file
i.e., C:\ArasTest\MyNewFileName.txt
Mode – The mode of operation for checkout
- FetchFileMode.Normal - In this mode, method performs file downloading to a defined target path. The return item has the
checkedout_pathproperty set to the value of the path where the file is downloaded. - FetchFileMode.Dry - In this mode, the method performs a “dry” run without downloading the physical file but checks if a file with same name exists in the specified target path. The return item has the
checkedout_pathproperty set to the value of the path to where the file would be downloaded. You can then use this path to determine if a file already exists in this path for further logic handling. No file is downloaded in this mode.
- FetchFileMode.Normal - In this mode, method performs file downloading to a defined target path. The return item has the
Example:
Item cadItem = inn.newItem(“CAD”, “add”);
Item myFile = cadItem.fetchFileProperty(“native_file”, filePath, FetchFileMode.Normal);
...