Upload 200KB files via WinSCP .NET assembly

Advertisement

nishalkr
Guest

Upload 200KB files via WinSCP .NET assembly

I am using WinSCP .NET assembly to upload files via SFTP. On uploading any files larger than 100kb, getting error messages "filepart could not be renamed to target file name, you may try to turn off transfer resume support.. In the .NET source code I added following code to disable the settings:
sessionOptions.AddRawSettings("ResumeSupport", "2")
sessionOptions.AddRawSettings("IgnorePermErrors", "1")
sessionOptions.AddRawSettings("PreserveTime", "0")
But still I am getting the same error message. While uploading it though GUI, I am not facing any issues, but using .NET assembly. I am not able to upload large files.

Reply with quote

Advertisement

nishalkr
Guest

Rename Permission issue while uploading the file via SFTP

I have downloaded 5.1.3 version of WINSCP.DLL to work with .NET. Use following code to ignore the error messages "filepart' could not be renamed to target file name. We don't have rename permission to the destination SFTP folder.
With sessionOptions
    .Protocol = Protocol.Sftp 
    .HostName = FTPAddr
    .UserName = FtpUserId
    .Password = FTPPassword
    .PortNumber = FTPPort
    .SshHostKeyFingerprint = sshHostKey 
    .AddRawSettings("ResumeSupport", "2")
    .AddRawSettings("IgnorePermErrors", "1")
    .AddRawSettings("PreserveTime", "0")
End With
Let me know, if this issue is fixed already with 5.1.3 version ?

Thank you.

Reply with quote

martin
Site Admin
martin avatar

Re: Rename Permission issue while uploading the file via SFTP

nishalkr wrote:

Let me know, if this issue is fixed already with 5.1.3 version ?
It's not. Will be fixed in 5.2, as per the tracker entry above.

Reply with quote

Advertisement

joey
Guest

5.2 Release Date or Beta Release

Any idea on the release date of 5.2 or beta release? Or, a way to get around the Resume Support using the .Net assembly, Or, even a trial piece of CPP to allow local builds to resolve?
Product is still awesome!!!

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: 5.2 Release Date or Beta Release

@joey: I can provide you development version for testing. Can you send me an email? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.

Reply with quote

Advertisement

hjackows
Joined:
Posts:
1
Location:
austin

Upload 200KB files via WINSCP .NET assembly

I just downloaded version 5.2 and I am still seeing the same issue. File could not be renamed..
Am I disabling the resume support correctly?
SessionOptions sessionOptions = new SessionOptions()
{
    Protocol = Protocol.Sftp,
    HostName = ConfigurationManager.AppSettings["sftp.host"],
    UserName = ConfigurationManager.AppSettings["sftp.userName"],
    Password = ConfigurationManager.AppSettings["sftp.password"],
    SshHostKeyFingerprint = ConfigurationManager.AppSettings["sftp.SshHostKeyFingerprint"],
};
       
sessionOptions.AddRawSettings("ResumeSupport", "2");
sessionOptions.AddRawSettings("IgnorePermErrors", "1");
sessionOptions.AddRawSettings("PreserveTime", "0");
Thanks Henry

Reply with quote

fightingfit99
Joined:
Posts:
2
Location:
York

Re: Upload 200KB files via WINSCP .NET assembly

@martin: Hi, I've just tried this I'm getting a message that the ResumeSupport property is readonly. Can you help? Full code:
Dim sftp As New SessionOptions
Dim session As New Session
Dim transfer As New TransferOptions
Dim result As TransferOperationResult
 
With sftp
    .Protocol = Protocol.Sftp
    .HostName = "***"
    .UserName = "***"
    .Password = "***"
    .SshHostKeyFingerprint = "***"
End With
 
session.Open(sftp)
transfer.ResumeSupport = TransferResumeSupport.Off  [property is readonly]
transfer.TransferMode = TransferMode.Binary
result = session.PutFiles("C:\xx.csv", "xx.csv", False, transfer)
result.Check()
Thank you.

Reply with quote

Advertisement

fightingfit99
Joined:
Posts:
2
Location:
York

Re: Upload 200KB files via WINSCP .NET assembly

Don't worry, fixed it myself:
transfer.ResumeSupport.State = TransferResumeSupportState.Off

Reply with quote

AnkitJetly
Guest

transferOptions.ResumeSupport.State = TransferResumeSupportState.Off;

transferOptions.ResumeSupport.State = TransferResumeSupportState.Off;

Reply with quote

Advertisement

You can post new topics in this forum