Frage

I need to send a file over FTP (I'm using commons-net Java library) using ASCII mode (can't use Binary mode because the host uses a different way of storing data), but I need the LF characters to stay as LF and not to be transformed to CRLF.

Indeed I need LF to stay as LF and CRLF to stay as CRLF. So far I couldn't find a way of doing this.

If there is no way of doing this with commons-net but someone knows how to do it with a different library would be appreciated

Thank you all for your responses. See you

Solution Finally I had to change to the ftp4j library, which works as I wanted out of the box.

Keine korrekte Lösung

Andere Tipps

The point of ASCII mode is exactly to have the line ending specific for the platform. So on UNIX system it will be LF and on windows CRLF. There is no way around it inside the client, because the server might convert the data. If you pass the data unmodified there is no way around using binary.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top