SaveFile(String,Byte[]) Method
- Last UpdatedNov 06, 2025
- 1 minute read
Function to save data to a specified file, overwriting the file if it already exists This override saves binary data to the file Return a FileInfo object in case it is needed for further processing Throw an exception if any error occurs (eg dir does not exist) - the public calling function must catch it
'Declaration
Public Overloads Shared Function SaveFile( _
ByVal completeFilePath As String, _
ByVal contents() As Byte _
) As FileInfo
'Usage
Dim completeFilePath As String
Dim contents() As Byte
Dim value As FileInfo
value = FileHelper.SaveFile(completeFilePath, contents)
public static FileInfo SaveFile(
string completeFilePath,
byte[] contents
)
Parameters
- completeFilePath
- The complete filename including its path as a string to save the data to
- contents
- The data to be saved in the file as a byte array
Return Value
Returns a FileInfo object for the newly created file