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
Joined:
Posts:
27,253
Location:
Prague, Czechia

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

nishalkr
Guest

Re: Rename Permission issue while uploading the file via SFTP

martin wrote:

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.

Any idea on the release date of 5.2

Reply with quote

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:
27,253
Location:
Prague, Czechia

Re: 5.2 Release Date or Beta Release

joey wrote:

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!!!
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

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: 5.2 availability

rad032 wrote:

I'm also in need of the #834 bug fix; is there anyway I can get a copy?
See my answer above.

Reply with quote

rad032
Joined:
Posts:
2
Location:
USA

Re: 5.2 availability

martin wrote:

rad032 wrote:

I'm also in need of the #834 bug fix; is there anyway I can get a copy?
See my answer above.


email sent, thanks!

Reply with quote

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

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Upload 200KB files via WINSCP .NET assembly

hjackows wrote:

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 ?
No you are not.
Use TransferOptions.ResumeSupport = TransferResumeSupport.Off
https://winscp.net/eng/docs/library_transferoptions

Last edited by martin on 2014-04-14; edited 1 time in total

Reply with quote

fightingfit99
Joined:
Posts:
2
Location:
York

Re: Upload 200KB files via WINSCP .NET assembly

martin wrote:

hjackows wrote:

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 ?
No you are not.
Use TransferOptions.ResumeSupport = TransferResumeSupport.Off

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

fightingfit99
Joined:
Posts:
2
Location:
York

Re: Upload 200KB files via WINSCP .NET assembly

fightingfit99 wrote:

martin wrote:

hjackows wrote:

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 ?
No you are not.
Use TransferOptions.ResumeSupport = TransferResumeSupport.Off

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.

Don.t worry, fixed it myself:

transfer.ResumeSupport.State = TransferResumeSupportState.Off

Reply with quote

Advertisement

You can post new topics in this forum