winscp.com /option value for ReplaceInvalidChars

Advertisement

sanandreas69
Joined:
Posts:
2
Location:
aut

winscp.com /option value for ReplaceInvalidChars

Hello everyone.

First post. Trying to get my head around WinSCP. I have 2 issues and think its caused by same reason.
Issues:
  • issuing lcd c:\folder1\folder2 the \ are being replaced with 2
    ie lcd c:folder12folder2
  • When a file is downloaded it has first - replaced with %2. But the second - is left!?
    ie my-name-is.txt is downloaded as my%2name-is.txt
I think its the ReplaceInvalidChars option for downloads. But I cannot seem to get the option right.

So in my script I have lots of paramaters for userid file name and the folders.
It's the lcd $local that's not working.
$local is c:\folder1\folder2
The get function downloads the file but WinSCP changes the file name.


I hope I have explained the problem well enough for some to offer guidance.
(I got cd around the \" cd $remote\" by putting the folder at the end of the server name used in the $server parameter).

Any help would be awesome. Been on this now for a week.

Cheers all.
Last edited by sanandreas69 on 2023-07-03 00:53; edited 1 time in total

Reply with quote

Advertisement

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

Re: winscp.com /option value for replaceinvalidcharacters

The first issue is imo issue of your Perl code. Try your lcd c:\folder1\folder2 on console. It should work. If it does not work in your Perl code that you are not actually passing lcd c:\folder1\folder2 to WinSCP.

The second issue: Dashes are not replaced. The problem is likely elsewhere. Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. 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

sanandreas69
Joined:
Posts:
2
Location:
aut

An update.

Issue now fixed. To answer you reply yes I can change to c:\folder1\folder2 in the WinSCP command line interface. The Perl script must be passing the command as I can see in the log file c:%2folder1%2folder2.

I reported 2 issues.
[list=1]
[*] To overcome the folder change issue I just added the folder path in the outputfile parameter and that was fixed.
[*] The issue with using \"option transfer rawtransfersettings ReplaceInvalidChars=0\" not working was its location. I was attempting to make it a global setting. This didnt work for me. So I moved into the executing command. Now it works.
Thanks for a very useful application.

Reply with quote

Advertisement

You can post new topics in this forum