Subject: CopyFiles Not Working
Date: 2015-03-09 11:24:40
From: Peter Kandra
Source: copyfiles-not-working
----------------------------------------------------------------------
Since the change from 6.0.40501 to 6.1.50120, the following code isn't working for copying files from one FTP system to another. It just sits there and hangs and doesn't copy anything:
[code lang='vb']
'create a daily folder on the corporate NAS and sync with the recordings on the office NAS
oFTPCorp.Connect(sIpAddressCorp, 21)
'Authenticate to corporate server...eventually look up the info in jkSite
Console.WriteLine(vbTab & "Authenticating to corporate NAS@..." & sIpAddressCorp & "...@ " & Now)
WriteLog("Info", "Process", sApp, vbTab & "Authenticating to corporate NAS@..." & sIpAddressCorp, "Kunnect", sSiteName, dProcessDate, , )
oFTPCorp.Authenticate("admin", "topkat")
oFTPCorp.Timeout = -1
oFTPCorp.KeepAlive()
oFTPCorp.KeepAliveDuringIdleInterval = 60
oFTPCorp.KeepAliveDuringTransferInterval = 60
'build a string for the daily folder and if it doesn't exist then create it
Dim sSourcePath As String = "/recordings/" & sDate
Dim sCorpPath As String = "/recordings/parkersburg2/" & sDate
'create the dated folder on the NAS
If oFTPCorp.DirectoryExists(sCorpPath) = False Then
oFTPCorp.CreateDirectory(sCorpPath)
End If
Dim optCorp As New TransferOptions()
optCorp.CreateEmptyDirectories = False
optCorp.SearchCondition = New NameSearchCondition("*.*")
optCorp.MoveFiles = False
optCorp.FileExistsResolveAction = FileExistsResolveAction.OverwriteOlderFiles
optCorp.Recursive = True
If oFTP.DirectoryExists(sRemotePath) = True Then
'NAS copy
Console.WriteLine(vbTab & "Copying files to Corporate NAS@..." & sIpAddressCorp & "...@ " & Now)
WriteLog("Info", "Process", sApp, vbTab & "Copying files to Corporate NAS@..." & sIpAddressCorp, "Kunnect", sSiteName, dProcessDate, , )
ComponentPro.IO.FileSystem.TransferFiles(oFTP, sRemotePath, Nothing, oFTPCorp, sCorpPath, optCorp, iCopyThreads, True)
WriteLog("Info", "Process", sApp, vbTab & "Finished Copying files to corporate NAS@..." & sIpAddressCorp, "Kunnect", sSiteName, dProcessDate, , )
Else
Console.WriteLine("ERROR...Kunnect Recording Date Folder: " & sDate & " doesn't exist...@ " & Now)
Writer.WriteLine("ERROR...Kunnect Recording Date Folder: " & sDate & " doesn't exist...@ " & Now)
WriteLog("Error", "Process", sApp, "ERROR...Kunnect Recording Date Folder: " & sDate & " doesn't exist...@ ", "Kunnect", , dProcessDate, , )
End If
'Disconnect.
oFTP.Disconnect()
oFTPCorp.Disconnect()
[/code]
----------------------------------------------------------------------
Note: This question has been asked on the Q&A forum of Thang Dang's fraudulent ComponentPro brand
If you purchased anything from ComponentPro, you have been scammed. Contact the payment processor
who sold you the license and ask for your money back.
Back to ComponentPro Q&A Forum Index