Extra line breaks while uploading the file on ftp server
-
Hi I am uploading a text file on a Linux server but after uploading when I download the same file again (to download again I am using CuteFTP) and open it then I see that there are an extra line breaks after each line. I am using
FtpWebRequest
method to upload the file whileUseBinary
is set to true. Can you please help me out asap? Regards,MAP Tiger Tiger Softwares Software Designer and Developer VB.NET, ASP.NET, VFP
-
Hi I am uploading a text file on a Linux server but after uploading when I download the same file again (to download again I am using CuteFTP) and open it then I see that there are an extra line breaks after each line. I am using
FtpWebRequest
method to upload the file whileUseBinary
is set to true. Can you please help me out asap? Regards,MAP Tiger Tiger Softwares Software Designer and Developer VB.NET, ASP.NET, VFP
This sounds like it could be a problem with the editor you are using. Linux (and most unix like os) use LF (linefeed, chr(&h0a)) to signify a new line. Windows uses CRLF (Carriage Return+Line Feed, chr(&h0d)+chr(&h0a)) I suspect that some editor you have used has converted from the Linux newline format to the windows newline format. If you could do a hex dump of the file at all stages, and check for the line breaks you should be able to see where this is happening. (oh, and CuteFTP is also set to use Binary for the specific file format you are using isnt it? ;) )
-
This sounds like it could be a problem with the editor you are using. Linux (and most unix like os) use LF (linefeed, chr(&h0a)) to signify a new line. Windows uses CRLF (Carriage Return+Line Feed, chr(&h0d)+chr(&h0a)) I suspect that some editor you have used has converted from the Linux newline format to the windows newline format. If you could do a hex dump of the file at all stages, and check for the line breaks you should be able to see where this is happening. (oh, and CuteFTP is also set to use Binary for the specific file format you are using isnt it? ;) )
Hi Thanks for the reply. Well I figured out that it was due to binary mode set to true so I just switched off binary mode and switched on passive mode and my problem solved. :) Problem was due to Linux server as it was manipulating the file if uploaded through binary mode and the file was huge too, and passive mode just did the trick so I am happy now. Regards,
MAP Tiger Tiger Softwares Software Designer and Developer VB.NET, ASP.NET, VFP