Delete a file in Local server after transferring the file
Dim transferOptions = New TransferOptions
transferOptions.ResumeSupport.State = TransferResumeSupportState.Off
transferOptions.PreserveTimestamp = False
transferResult = session.PutFiles(UploadFromFolder + filename.FileName, ClientFolderPath, False, transferOptions)
transferResult.Check()
File.Copy(UploadFromFolder + filename.FileName, BackupFolder + Path.GetFileName(filename.FileName))
File.Delete(UploadFromFolder + filename.FileName)
File.Delete gives error that the file is used by another process and cannot delete. It is just a text file and the transfer somehow locks it I think.
transferOptions.ResumeSupport.State = TransferResumeSupportState.Off
transferOptions.PreserveTimestamp = False
transferResult = session.PutFiles(UploadFromFolder + filename.FileName, ClientFolderPath, False, transferOptions)
transferResult.Check()
File.Copy(UploadFromFolder + filename.FileName, BackupFolder + Path.GetFileName(filename.FileName))
File.Delete(UploadFromFolder + filename.FileName)
File.Delete gives error that the file is used by another process and cannot delete. It is just a text file and the transfer somehow locks it I think.