ftp client - Download file from FTP in original format -


i using org.apache.commons.net.ftp.ftpclient.retrivefile(string,outputstream) download file ftp windows machine. when download 1 text file it's format missing. when open downloaded file in notepad it's not looking original one. please find difference in attached screenshots. please find below code , please let me know solution same.

fileoutputstream fos = new fileoutputstream(temppath+file.separator+files[i].getname()); this.ftpclient.retrievefile(files[i].getname(), fos); fos.close(); 

downloaded file when open in notepad-it's looking in incorrect format

original file when open on notepad-looking table format

the file has not been changed, transport protocols ftp never change content of file itself. @ modify header informations.

what observe result of different visualization of whitespaces contained in file. example tab characters may visualized using different amount of spaces, resulting in different indentation.

this case might result of different line width: apparently first screenshot shows lines being wrapped @ length. missing linebreaks typical result of different way how different systems code linebreaks. ms-windows uses different line encoding other systems (incompatibility purpose). try using editor intelligent linebreak handling. or 1 can chose linebreak in explicit manner.

so issue not ftp problem, (most likely) has different software or settings use on both machines.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -