ssmith-nova
5 months agoNew Contributor III
Reading a file written to a user folder.
I have the routine below that exports data from a datatable to a file. I am writing to "Documents\Users\" & si.UserName. The file gets created correctly; I am now trying to pick up that file with a business rule. I am not familiar with all of the XF file functions. I need to ftp that file to a remote server.
How do I go about getting the full path the Document\Users folder from another Business Rule.
Public Function DataTableToFile(ByVal si As SessionInfo, ByVal dt As DataTable, ByVal strFilePath As String, ByVal listColToSkip As List(Of String), ByVal Optional strSeparator As String = ",") As XFFileEx
Dim strDt As String = Me.PrintDataTable(si, dt, strSeparator, 0, False, listColToSkip, """")
Dim bytes() As Byte = System.Text.Encoding.UTF8.GetBytes(strDt)
Dim fileinfo As New XFFileInfo(fileSystemLocation.ApplicationDatabase, strFilePath)
Dim xfFile As New XFFile(fileinfo, String.Empty, bytes)
BRApi.FileSystem.InsertOrUpdateFile(si, xffile)
Dim xfeFile As New XFFileEx(xffile, DataAccessLevel.AllAccess, False)
Return xfeFile
End Function
Well, i think there are differences depending on where you save it:
The file share are actual folders (grey) i think, whereas the Documents/Public etc. sit on the Application Database.