Error transferring file - No such file or folder. Syntax error in parameters or arguments.

Advertisement

acem77
Joined:
Posts:
22
Location:
usa

Error transferring file - No such file or folder. Syntax error in parameters or arguments.

Hello,
Is there a simple method to correct this, so winscp looks at the file name as just a name?
Thanks

see below some files names with "% and numbers " cause winscp to interpenetrate it as "/"
"%2f" to "/"
plus others that cause this error "Syntax error in parameters or arguments."


source "*_%2F9%5FVNE%2DJ_Index15970626.pdf" ftp upload info "*_/9%5FVNE%2DJ_Index15970626.pdf"

Error transferring file '\\clenas01\abc_filegroup$\fg1\FILE GROUP 95\https___pam.cws-gr.com_audits-audTrans-print.cfm_%2F9%5FVNE%2DJ_Index15970626.pdf'.
Copying files to remote side failed.
https___pam.cws-gr.com_audits-audTrans-print.cfm_/9%5FVNE%2DJ_Index15970626.pdf: No such file or folder.


Error transferring file '\\clenas01\abc_filegroup$\fg1\FILE GROUP 95\https___pam.cws-gr.com_audits-auditReport.cfm_%2F%3C%24%3A%3DHJ_Index15965236.pdf'.
Copying files to remote side failed.
Syntax error in parameters or arguments.

Error transferring file '\\clenas01\abc_filegroup$\fg1\FILE GROUP 95\https___pam.cws-gr.com_audits-audTrans-print.cfm_%2E%3C%24%3A%3_Index15968099.pdf'.
Copying files to remote side failed.
Syntax error in parameters or arguments.

Reply with quote

Advertisement

acem77
Joined:
Posts:
22
Location:
usa

looks to be related to the Transfer settings - filename modification - replace "\:*?`"
I uncheck this in the GUI is will this be reflected while running in PS,
its set to true?
"DefaultConfiguration : True"

If not how would I set it to replace?

PS C:\Users\19202> $session
ExecutablePath :
ExecutableProcessUserName :
ExecutableProcessPassword :
AdditionalExecutableArguments :
DefaultConfiguration : True
DisableVersionCheck : False


Thanks

Reply with quote

Advertisement

acem77
Joined:
Posts:
22
Location:
usa

I tried this,

$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.FileMask = "| ~*"
$transferOptions.AddRawSettings("ReplaceInvalidChars", "0")

here is what I see,
PS C:\Users\1234> $transferOptions
PreserveTimestamp : True
FilePermissions :
TransferMode : Binary
FileMask : | ~*
ResumeSupport : default
SpeedLimit : 0
OverwriteMode : Overwrite

what I get.
Log
Error: Method invocation failed because [WinSCP.TransferOptions] does not contain a method named 'AddRawSettings'.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
30,449
Location:
Prague, Czechia

OK, I (and the documentation) forgot to mention that the TransferOptions.AddRawSettings method is available in the latest RC version of WinSCP only (5.14).

In the older versions, you should be able to use:
$session.AddRawConfiguration("Interface\CopyParam\ReplaceInvalidChars", "0")

Though 5.14 will be released as stable in few days (as 5.15).

Reply with quote

acem77
Joined:
Posts:
22
Location:
usa

Thanks this works now,

$session = New-Object WinSCP.Session
try
{
# Will continuously report progress of synchronization
$session.add_FileTransferred( { FileTransferred($_) } )
$session.AddRawConfiguration("Interface\CopyParam\ReplaceInvalidChars", "0")

Reply with quote

Advertisement

You can post new topics in this forum