Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.4k views
in .NET FTP by (1.5k points)
Hi

Can anyone tell me what this might mean?

I have this in a SecureFTPConnection1_Uploaded event -
Dim sFile As String = IO.Path.ChangeExtension(e.LocalFile, MediaExt)
ftpConnection.BeginDeleteFile(sFile, New AsyncCallback(AddressOf OnRename), ftpConnection)
ftpConnection.BeginRenameFile(e.RemoteFile, sFile, New AsyncCallback(AddressOf OnRename), ftpConnection)

I see that the Private Sub OnRename(ByVal ar As IAsyncResult) event is being fired twice for each file processed by BeginRenameFile.
The first time it throws this exception but the second time it works.
Incompatible IAsyncResult object was returned by a call to the BeginRenameFile method

I can't see what is causing this exception or what it actually means. Any help appreciated.

cheers
malcom

2 Answers

0 votes
by (51.6k points)
Hi Malcom

I think the problem is in this line:
ftpConnection.BeginDeleteFile(sFile, New AsyncCallback(AddressOf OnRename), ftpConnection)

Shouldn't that be OnDelete rather than OnRename?

- Hans (EnterpriseDT)
0 votes
by (1.5k points)
Well that's embarrassing. You've no idea how many hours I've wasted staring at that code... Can't see the forrest for the trees.

Thanks Hans. Much appreciated

cheers
Malcom

Categories

...