Ok, thanks Martin.
- Dan Curious
TransferOperationResult.IsSuccess
– what you are already doing. The log file shall not be used for any decisions.
transferResult.Check
Result_x = transferResult.IsSuccess()
If Err.number <> 0 Then
Transfer_Succeeded_b = False
ErrorNumber = Err.number
ErrorDescription = Err.Description
ErrorSource = Err.Source
Err.Clear
Call udfs_LogError( "Problem Transferring " & File_From_s & " to " & File_To_s, ErrorNumber, ErrorDescription, ErrorSource )
Call udfs_SendErrorMessage( "Problem Transferring " & File_From_s & " to " & File_To_s, ErrorNumber, ErrorDescription, ErrorSource )
End If
. 2021-08-24 07:03:24.865 Script: Exit code: 0
< 2021-08-16 06:30:43.390 Type: SSH_FXP_STATUS, Size: 40, Number: 1033
< 2021-08-16 06:30:43.391 Status code: 8, Message: 1033, Server: Operation unsupported, Language: en
* 2021-08-16 06:30:43.393 (ETerminal) The server does not support the operation.
TransferOptions_obj.PreserveTimestamp = False
"put -nopermissions -preservetime -transfer="binary" -rawtransfersettings[3] IgnorePermErrors="1" PreserveTimestamp="0" Permissions="0""
TransferOptions_obj.TransferMode = 0
TransferOptions_obj.AddRawSettings "IgnorePermErrors", "1"
TransferOptions_obj.AddRawSettings "PreserveTimestamp", "0"
TransferOptions_obj.AddRawSettings "Permissions", "0"
c:\windows\microsoft.NET\Framework64\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb
Microsoft .NET Framework Assembly Registration Utility version 4.8.3752.0
for Microsoft .NET Framework version 4.8.3752.0
Copyright (C) Microsoft Corporation. All rights reserved.
Types registered successfully
RegAsm : error RA0000 : An error occurred while saving the exported type library: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
WinSCPNet.dll 1/26/2021, 8:07 am
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.wscp_GetTransferOptions
with PutFiles
.
Upload of file 'XXXXX' was successful, but error occurred while setting the permissions and/or timestamp.
If the problem persists, turn off setting permissions or preserving timestamp. Alternatively you can turn on 'Ignore permission errors' option. ("The server does not support the operation.")
PutFiles()
. I don't remember why we are using RawSettings
; I think it's because a straight assignment like
TransferOptions_obj.Permissions = False
Function wscp_GetTransferOptions
Dim TransferOptions_obj
Set TransferOptions_obj = WScript.CreateObject( "WinSCP.TransferOptions" )
' TransferOptions_obj.OverwriteMode = OverwriteMode_Overwrite
' TransferOptions_obj.PreserveTimestamp = False
' TransferOptions_obj.Permissions = False
' TransferOptions_obj.AddRawSettings "PreserveTimeDirs", 1
TransferOptions_obj.AddRawSettings "IgnorePermErrors", 1
TransferOptions_obj.AddRawSettings "PreserveTimestamp", 0
If Err.number <> 0 Then
Transfer_Succeeded_b = False
ErrorNumber = Err.number
ErrorDescription = Err.Description
ErrorSource = Err.Source
Err.Clear
Call udfs_LogError( "Problem with Transfer options", ErrorNumber, ErrorDescription, ErrorSource )
End If
Set wscp_GetTransferOptions = TransferOptions_obj
End Function