Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

appleton98

Forgot to say I am using WinSCP version 5.5.1 build 3970.
appleton98

scripting question

Hi,
unfortunately this issue was resolved but has occurred once again. I have included a screen shot of the transfer settings. When i manually copy one file from the source to the SFTP server from within WinSCP GUI interface these settings are utilized and I am happy, however when I use a script it ignores these settings and the file contains the three characters once again (as the original also does) Is there a better way to transfer files though a script that will force it to use the settings listed? I have not only added a new settings config but also changed all the others that come with WinSCP to match thinking it must use one of them, but it appears not.
My current transfer script is below
open f***r:q******r@sftp**.********.co.uk
cd /incoming/BO
put -delete "C:\SFTP\*****\Business Objects\*.*"

due to the nature of the company I work for I have had to * out some information.

Is there a way to force the script to use the transfer settings or should I be using a different command to complete file transfer?
Many thanks
martin

Please attach a full log file showing upload of a file using 5.5.2 with BOM removing enabled (but not happening).
appleton98

Hello,
With remove BOM enables it does not appear to remove the BOM characters from the file.
I am trying to change the encoding from UTF-8 to Ansi to see whether the three control characters have been removed.
The customer who i am trying to help requires that the characters be removed however uploading their exported file is automated and it sees the three characters and rejects the file accordingly. I have changed the encoding on files from version 4.3.5 and they do not have this issue. Currently we have moved this customer to our old server running 4.3.5 but this is not realistically a permanent solution.
martin

Re: File transfer creates 3 lead characters

It's difficult to debug this remotely.
So when you have the BOM removing enabled, does the BOM disappear from the file on upload or not?

Also, what is the actual problem? Why are you even trying to change the encoding in WinSCP from UTF-8 to Ansi, when the file is (probably) in UTF-8 (providing it does have UTF-8 BOM)?
appleton98

Re: File transfer creates 3 lead characters

I had previously set WinSCP to remove the BOM remarks but to no avail. The system basically picks up a file from a server and places it into a folder on an SFTP server. Is there something I'm doing wrong?
appleton98

Re: File transfer creates 3 lead characters

Having checked the original file before WinSCP sees it appears it does indeed have the BOM included on its own. To do this i had to use the internal editor of WinSCP from version 5.5.1
I am using SFTP protocol in both cases however i had made a mistake in the revisions. The new version is indeed 5.5.1 however the old version is not 5.1 but is in fact version 4.3.5 build 1463, apologies.
If I transfer the same file from the same location using version 4.3.5 and then open it with the internal editor of 5.5.1 then the three characters do not appear when the encoding is changed between UTF-8 to 1252 ANSI latin 1 and back again. However do exactly the same with version 5.5.1 and they do.

I have enclosed two images from both versions showing the Editor page.
In version 5.5.1 I have tried the transfer with both 1252 ANSI chosen as default and then UTF-8 with the same result.

Is there anything else you could think of I could try?
We upgraded from version 4.3.5 to 5.5.1 in order to fix an authentication problem and the new version allowed us to use the switch -hostkey="*" after the login process to solve that.
martin

Re: File transfer creates 3 lead characters

The three characters are UTF-8 BOM mark:
https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8

I suppose the file has the BOM included on its own. When you open the file in WinSCP internal editor, it autodetects the UTF-8 encoding by its presence (and does not show the mark as it's not part of a contents). If you force WinSCP to interpret the file in ANSI encoding, it displays these characters as if they were part of the contents. But this has not changed between 5.1 and 5.5.1. Can you please test this once again using 5.1?

If the above does not explain what you experience, I have further questions:

What encoding do you have configured as default in Preferences?
https://winscp.net/eng/docs/ui_pref_editor

Am I right assuming you are using WinSCP internal editor, right?

What protocol? FTP or SFTP?

Is the BOM present in the file before upload? (the file is 3 bytes longer than its contents if BOM is included).
appleton98

File transfer creates 3 lead characters

On revision 5.1 build 3799 this did not occur but on version 5.5.1 build 3970 it does and its frustrating.
We copy a file that Business Objects creates from one server to a SFTP server in ASCII and all appears fine. If you then open the text file within WinSCP and select ENCODING from the menu and change it from UTF-8 to 1252 ANSI latin 1 the file suddenly has these three symbols at the start of the file. 
Files transferred in the old version do not have this issue.

Unfortunately due to the nature of the file content i can not post it on here.