fix file access error and illegal path error
This commit is contained in:
@@ -6,21 +6,26 @@ Imports DigitalData.Modules.Language
|
||||
Imports Limilabs.Mail
|
||||
|
||||
Public Class ClassFilehandle
|
||||
Public Shared Function Decide_FileHandle(pFilepath As String, pHandletype As String)
|
||||
Public Shared Function Decide_FileHandle(pFilepath As String, pHandletype As String) As Boolean
|
||||
Try
|
||||
'TODO: Before doing anything, clean the filename
|
||||
Dim oFilename = IO.Path.GetFileName(pFilepath)
|
||||
Dim oCleanFileName = Utils.RemoveInvalidCharacters(oFilename)
|
||||
Dim oTempDirectory = IO.Path.GetTempPath()
|
||||
Dim oTempFilePath = IO.Path.Combine(oTempDirectory, oCleanFileName)
|
||||
''TODO: Before doing anything, clean the filename
|
||||
'Dim oFilename = IO.Path.GetFileName(pFilepath)
|
||||
'Dim oCleanFileName = Utils.RemoveInvalidCharacters(oFilename)
|
||||
'Dim oTempDirectory = IO.Path.GetTempPath()
|
||||
'Dim oTempFilePath = IO.Path.Combine(oTempDirectory, oCleanFileName)
|
||||
|
||||
Try
|
||||
TEMP_FILES.Add(oTempFilePath)
|
||||
IO.File.Copy(pFilepath, oTempFilePath, True)
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
'Try
|
||||
' TEMP_FILES.Add(oTempFilePath)
|
||||
' LOGGER.Debug("Copying file")
|
||||
' LOGGER.Debug(pFilepath)
|
||||
' LOGGER.Debug(oTempFilePath)
|
||||
' IO.File.Copy(pFilepath, oTempFilePath, True)
|
||||
'Catch ex As Exception
|
||||
' LOGGER.Error(ex)
|
||||
' Throw ex
|
||||
'End Try
|
||||
|
||||
Dim oTempFilePath = pFilepath
|
||||
|
||||
If oTempFilePath.ToUpper.EndsWith(".MSG") Or oTempFilePath.ToUpper.EndsWith(".EML") Then
|
||||
CURRENT_MESSAGEID = ""
|
||||
|
||||
Reference in New Issue
Block a user