ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to do SFTP in WMB in ASCII mode?

Post new topic  Reply to topic
 How to do SFTP in WMB in ASCII mode? « View previous topic :: View next topic » 
Author Message
Garima
PostPosted: Wed Nov 24, 2010 7:34 am    Post subject: How to do SFTP in WMB in ASCII mode? Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Wed Nov 24, 2010 8:36 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Wed Nov 24, 2010 9:57 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Wed Nov 24, 2010 12:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
rekarm01
PostPosted: Wed Nov 24, 2010 1:41 pm    Post subject: Re: How to do SFTP in WMB in ASCII mode? Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Thu Nov 25, 2010 1:31 am    Post subject: Re: How to do SFTP in WMB in ASCII mode? Reply with quote

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
View user's profile Send private message
Garima
PostPosted: Thu Nov 25, 2010 10:37 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu Nov 25, 2010 11:55 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Thu Nov 25, 2010 2:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to do SFTP in WMB in ASCII mode?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.