Topic "How to remove BOM (byte order mark)"

Author Message
johnwulp
[View user's profile]

Joined: 2014-07-04
Posts: 1
Hi,

I am using the following code, how can i remove the BOM?

Code:
 Try
                ' Setup session options
                Dim sessionOptions As New SessionOptions
                With sessionOptions
                    .Protocol = Protocol.Sftp
                    .HostName = My.Settings.SFTPServer
                    .UserName = My.Settings.SFTPUsername
                    .Password = My.Settings.SFTPPassword
                    .PortNumber = My.Settings.SFTPPort
                    .SshHostKeyFingerprint = My.Settings.SSHKeyFingerPrint
                End With

                Using session As Session = New Session
                    ' Connect
                    session.Open(sessionOptions)

                    ' Upload files
                    Dim transferOptions As New TransferOptions
                    transferOptions.TransferMode = TransferMode.Binary

                    Dim transferResult As TransferOperationResult
                    transferResult = session.PutFiles("c:\bla.xml", My.Settings.SFTPRemoteUploadPath, False, transferOptions)

                    ' Throw on any error
                    transferResult.Check()

                    ' Print results
                    Dim transfer As TransferEventArgs
                    For Each transfer In transferResult.Transfers
                        Messagebox.show ("Uploaded: " & transfer.FileName)
                    Next
                End Using
            Catch e As Exception
                Messagebox.show (e.Message.ToString)
            End Try


Thanks in advance
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
There's no API for that in WinSCP .NET assembly. But you can remove it programmatically yourself before upload.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License