Networking
1753543 Members
5714 Online
108795 Solutions
New Discussion юеВ

Re: file corrupts when ftp from windows pc showin ^M at end of line

 
SOLVED
Go to solution
HPTEAM
Occasional Contributor

file corrupts when ftp from windows pc showin ^M at end of line

File is getting corrupted when ftp is done from window pc to Unix server.

while doing more it doesn't shows ^M
but when opened in vi editor it shows ^M

Question:- Is there any secure method to copy from window to unix.?
5 REPLIES 5
Jon Finley
Honored Contributor

Re: file corrupts when ftp from windows pc showin ^M at end of line

SFTP
http://www.google.com/search?hl=en&q=sftp+download&aq=6&oq=SFTP

Jon
"Do or do not. There is no try!" - Yoda
Uwe Zessin
Honored Contributor
Solution

Re: file corrupts when ftp from windows pc showin ^M at end of line

I don't think the file becomes 'corrupted'...

If this is a text file use ASCII mode for transfers. It will convert the line terminators from CRLF to LF.
.
Alan_152
Honored Contributor

Re: file corrupts when ftp from windows pc showin ^M at end of line

You actually have two questions here:

1) to get rid of the control characters in your file transfer, switch from BIN to ASCII mode from the ftp command line. If that doesn't work, switch from ASCII to BIN.

2) To get a secure file transfer between a windows and *nix box, I use a free windows utility called WinSCP (downloadable from WinSCP.net). This assumes, of course, that the SCP and SSH daemons are running on the *nix box.
Dennis Handly
Acclaimed Contributor

Re: file corrupts when ftp from windows pc showin ^M at end of line

You can also run dos2ux(1) to remove those carriage returns.
HPTEAM
Occasional Contributor

Re: file corrupts when ftp from windows pc showin ^M at end of line

During setting up a Servicegaurd cluster, all the filesystem to be mounted as a part of the package are to be populated in the control scripts.
As the number of filesystems to be entered in the file were huge, we created the file in windows and ftp'd to HP-UX box. This used to put a control character.
As rightly suggested we were using binary mode to transfer text file which caused the control character to appear.
Resolution: Use ASCII mode to transfer text files.
Thanks all for the help.