Author |
Message
|
Garima |
Posted: Wed Nov 24, 2010 7:34 am Post subject: How to do SFTP in WMB in ASCII mode? |
|
|
Newbie
Joined: 23 Nov 2010 Posts: 7
|
Hi
I m transfering an xml file from one location to another using SFTP.
The transfer mode property is not enbled for SFTP option.
At destination, a special character is coming at the end of each line in the file.
Can anyone help me do SFTP without receiving any junk characters in the output file. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Nov 24, 2010 8:36 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
SFTP does not perform the same ASCII line ending conversion that regular FTP can do (unless you tell it not to by setting BINARY transfer mode).
That is, SFTP *always* does BINARY transfer.
If you are receiving an "extra" character at the line ending, it is because you are writing data in Windows text format that uses <CR><LF>, and sending it to a Unix system that expects only an <LF>. |
|
Back to top |
|
 |
zpat |
Posted: Wed Nov 24, 2010 9:57 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
So when I use winscp and connect over sftp to a Unix box and tell it to transfer in text mode - then it's winscp handling the CRLF conversion to LF? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Nov 24, 2010 12:35 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
zpat wrote: |
So when I use winscp and connect over sftp to a Unix box and tell it to transfer in text mode - then it's winscp handling the CRLF conversion to LF? |
Probably.... ?
Are you sure winscp is doing SFTP and not doing SCP?
And, I admit, I've not actually read the SFTP RFC. But to the best of my unchecked knowledge, SFTP is not FTP over SSL. FTPS is FTP over SSL. SFTP is an entirely different protocol, that again AFAIK does not do line ending conversion. |
|
Back to top |
|
 |
rekarm01 |
Posted: Wed Nov 24, 2010 1:41 pm Post subject: Re: How to do SFTP in WMB in ASCII mode? |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
zpat wrote: |
So when I use winscp and connect over sftp to a Unix box and tell it to transfer in text mode - then it's winscp handling the CRLF conversion to LF? |
SFTP version 4 (and later versions) supports text mode; SFTP version 3 (and earlier versions) do not.
WinSCP emulates text mode for earlier versions of SFTP.
The WMB FileInput node, FileOutput node, and FTPServer do not currently support text mode for any version of SFTP.
XML works the same way, regardless of file transfer mode. |
|
Back to top |
|
 |
zpat |
Posted: Thu Nov 25, 2010 1:31 am Post subject: Re: How to do SFTP in WMB in ASCII mode? |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
rekarm01 wrote: |
zpat wrote: |
So when I use winscp and connect over sftp to a Unix box and tell it to transfer in text mode - then it's winscp handling the CRLF conversion to LF? |
SFTP version 4 (and later versions) supports text mode; SFTP version 3 (and earlier versions) do not.
WinSCP emulates text mode for earlier versions of SFTP.
The WMB FileInput node, FileOutput node, and FTPServer do not currently support text mode for any version of SFTP.
XML works the same way, regardless of file transfer mode. |
I suppose IBM considers that WMB can handle the conversion of data but it would be nice (for support reasons if nothing else) to optionally convert during the SFTP process. |
|
Back to top |
|
 |
Garima |
Posted: Thu Nov 25, 2010 10:37 am Post subject: |
|
|
Newbie
Joined: 23 Nov 2010 Posts: 7
|
If you are receiving an "extra" character at the line ending, it is because you are writing data in Windows text format that uses <CR><LF>, and sending it to a Unix system that expects only an <LF>.
yeah thats wat i was doing, but how to overcome this problem? |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Nov 25, 2010 11:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Garima wrote: |
If you are receiving an "extra" character at the line ending, it is because you are writing data in Windows text format that uses <CR><LF>, and sending it to a Unix system that expects only an <LF>.
yeah thats wat i was doing, but how to overcome this problem? |
Add the right "encoding" declaration into your xml. It should describe the character code set you are using...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Nov 25, 2010 2:11 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I always like
Code: |
perl -wpi -e "s/\r//g;" |
But of course, that's a might difficult to run *inside* of Broker. |
|
Back to top |
|
 |
|