I'm trying to get the FileID of a file based on the FileName. This is what I have, but it returns false. Any ideas?
Dim oFileInfo As New DotNetNuke.Services.FileSystem.FileInfo
oFileInfo.FileName = "4secapplication.PNG"
Dim FileID As Integer
Dim oFolderInfo As New DotNetNuke.Services.FileSystem.FolderInfo
oFolderInfo.FolderPath = "uploads/files/"
If FileManager.Instance.FileExists(oFolderInfo, "4secapplication.PNG") = True Then
FileID = oFileInfo.FileId
Else
lblExceptions.Text = "not exists"
End If
I suggest you something like that:
Or a shortest method: