Can't rename .filepart

Advertisement

cbrennen
Joined:
Posts:
1
Location:
CT

Can't rename .filepart

I have gone ahead and set resume support to off in my code but it is still creating a file with the .filepart extension.
Using session As New Session
    ' Connect
    session.Open(sessionOptions)
 
    ' Set up transfer options
    Dim transferOptions As New TransferOptions
    With transferOptions
        .ResumeSupport = New TransferResumeSupport With {.State = TransferResumeSupportState.Off}
    End With
 
    ' Transfer files
    session.PutFiles(filepath, "/To/*").Check()
End Using
WinSCP.SessionRemoteException
  HResult=0x80131500
  Message=Transfer was successfully finished, but temporary transfer file 'p-20220929-239-0-0-0.txttest.pgp.filepart' could not be renamed to target file name 'p-20220929-239-0-0-0.txttest.pgp'. If the problem persists, you may try to turn off transfer resume support.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Can't rename .filepart

Your code never uses the transferOptions variable.
It should be:
session.PutFiles(filepath, "/To/*", False, transferOptions).Check()

Reply with quote

Advertisement

You can post new topics in this forum