unable to upload

Advertisement

rvergin
Guest

unable to upload

I am unable to upload a file. The error message the upload was successful but error occurred while setting the permissions and/or timestamp. I set preservetimestamp to false. I am using vb.net. I still get the error. I don't see where I can turn off permissions.

Reply with quote

Advertisement

revergin
Joined:
Posts:
2
Location:
Southfield, MI

Re: unable to upload

vendor states they require SSH2. Is that a problem for WinSCP? or a contributing factor to this problem?

Reply with quote E-mail

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

Re: unable to upload

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

rvergin
Guest

Re: unable to upload

martin wrote:

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Here is my code. I am unable to find the log file.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
' Setup session options
Dim sessionOptions As New SessionOptions
With sessionOptions
.Protocol = Protocol.Sftp
.HostName = "host"
.UserName = "user"
.Password = "pass"
.PortNumber = 22


.SshHostKeyFingerprint = "ssh-rsa 2048 d5:e9:b2:29:16:a3:09:fb:e8:6d:67:72:be:88:c8:d6"
End With

Using session As New Session

session.SessionLogPath = "p:\comerica\log.xml"

' Connect
session.Open(sessionOptions)


' Upload files
Dim transferOptions As New TransferOptions
transferOptions.TransferMode = TransferMode.Ascii
transferOptions.PreserveTimestamp = False

Dim transferResult As TransferOperationResult
transferResult = session.PutFiles("p:\Comerica\DataVault\ACH\TPEPILOCOMOTVSFTP.EFTCLAIMS 09-06-2017 - Copy.txt", "/To_Comerica/TPEPILOCOMOTVSFTP.txt")
'https://sftp.comerica.com/?token=20079AB7-94AE-11e7-80E2-42F2E966EE8F#/To_Comerica/

' Throw on any error
transferResult.Check()

' Print results
For Each transfer In transferResult.Transfers
Debug.Print("Upload of {0} succeeded", transfer.FileName)
Next
End Using

'Return 0
Catch 'e As Exception
Console.WriteLine("Error: {0}", e)
'Return 1
End Try


End Sub

Reply with quote

rvergin
Guest

Re: unable to upload

rvergin wrote:

martin wrote:

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Here is my code. I am unable to find the log file.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
' Setup session options
Dim sessionOptions As New SessionOptions
With sessionOptions
.Protocol = Protocol.Sftp
.HostName = "host"
.UserName = "user"
.Password = "pass"
.PortNumber = 22


.SshHostKeyFingerprint = "ssh-rsa 2048 d5:e9:b2:29:16:a3:09:fb:e8:6d:67:72:be:88:c8:d6"
End With

Using session As New Session

session.SessionLogPath = "p:\comerica\log.xml"

' Connect
session.Open(sessionOptions)


' Upload files
Dim transferOptions As New TransferOptions
transferOptions.TransferMode = TransferMode.Ascii
transferOptions.PreserveTimestamp = False

Dim transferResult As TransferOperationResult
transferResult = session.PutFiles("p:\Comerica\DataVault\ACH\TPEPILOCOMOTVSFTP.EFTCLAIMS 09-06-2017 - Copy.txt", "/To_Comerica/TPEPILOCOMOTVSFTP.txt")
'https://sftp.comerica.com/?token=20079AB7-94AE-11e7-80E2-42F2E966EE8F#/To_Comerica/

' Throw on any error
transferResult.Check()

' Print results
For Each transfer In transferResult.Transfers
Debug.Print("Upload of {0} succeeded", transfer.FileName)
Next
End Using

'Return 0
Catch 'e As Exception
Console.WriteLine("Error: {0}", e)
'Return 1
End Try


End Sub

Vendor states that the error may be du to the fact that the file I am uploading is in a polled folder and is almost immediately moved to a production error. It may be happening before the WinSCP upload process has time to set the permissions on the file. How do I turn the setting of permissions off?

Reply with quote

Advertisement

Guest

Re: unable to upload

rvergin wrote:

I am unable to upload a file. The error message the upload was successful but error occurred while setting the permissions and/or timestamp. I set preservetimestamp to false. I am using vb.net. I still get the error. I don't see where I can turn off permissions.

Day 2

Any body know how to turn off permission settings on a file upload?

Reply with quote

Guest

Re: unable to upload

Anonymous wrote:

rvergin wrote:

I am unable to upload a file. The error message the upload was successful but error occurred while setting the permissions and/or timestamp. I set preservetimestamp to false. I am using vb.net. I still get the error. I don't see where I can turn off permissions.

Day 2

Any body know how to turn off permission settings on a file upload?

still day 2 actually 6

set transferoptions.filepermissions = nothing

still get error.

Now do Any body know how to set the ignore errors ?

Reply with quote

revergin
Joined:
Posts:
2
Location:
Southfield, MI

Re: unable to upload

rvergin wrote:

I am unable to upload a file. The error message the upload was successful but error occurred while setting the permissions and/or timestamp. I set preservetimestamp to false. I am using vb.net. I still get the error. I don't see where I can turn off permissions.

end of day 2 (6)

No response yet. I have fixed my problem. I still don't know where the log file is.

Reply with quote E-mail

martin
Site Admin
martin avatar

Re: unable to upload

So do you still need any help?

Instructions for obtaining the session log is in my previous reply.

Reply with quote

Advertisement

You can post new topics in this forum