' Convert to Base64 Public Function ConvertToBase64() As Boolean Dim llSuccess As Boolean = False Dim loFileFunction As Framework.FileFunction = Nothing ' Get the proper definition as per the current scope If oProcess Is Nothing Then loFileFunction = New Framework.FileFunction(oApp) Else loFileFunction = New Framework.FileFunction(oProcess) End If ' Reset the values cEncoded = "" cMessage = "" Try ' If we cannot create a string from the file loFileFunction.cFile = cFile If Not loFileFunction.FileToStringBinary() Then cMessage = loFileFunction.cMessage Return False End If cEncoded = Convert.ToBase64String(System.Text.Encoding.Default.GetBytes(loFileFunction.cString)) llSuccess = True Catch loError As Exception cMessage = loError.Message End Try ' Reset the values cFile = "" Return llSuccess End FunctionI first need to collect the file into a string before encoding it.