RFC 959 - File Transfer Protocol faqs.org/rfcs
The difference between passive and active mode FTP ipswitch.force.com/kb
- Ipswitch recommends passive (firewall-friendly)
Active FTP vs. Passive FTP, a Definitive Explanation slacksite.com
- includes sequence diagrams for passive and active FTP
FTP Connection refused error – Solution to problem cyberciti.biz
Troubleshooting tips for FTP connection refused condition
FTP batch download only new files dostips.com
[End of line and conversion between platforms]
Newline wikipedia.org
good summary of newline representation, by platform
ASCII: CR, LF, or CR + LF
CR: carriage return, \r, 0x0D, 13 decimal
LF: line feed, \n, 0x0A, 10 decimal
LF: Unix, Linux
CR + LF: Windows
EBCDIC:
NL: new line, 0x15
NL: i5/OS (OS400)
Most textual Internet protocols (including HTTP, SMTP, FTP, IRC and many others) mandate the use of ASCII CR+LF ('\r\n', 0x0D 0x0A) on the protocol level, but recommend that tolerant applications recognize lone LF ('\n', 0x0A) as well. In practice, there are many applications that erroneously use the C newline character '\n' instead (see section Newline in programming languages below).
FTP has a feature to transform newlines between CR+LF and the native encoding of the system (e.g., LF only) when transferring text files. This must not be used on binary files. Often binary files and text files are recognised by checking their filename extension; most command line FTP clients have an explicit command to switch between binary vs. text mode transfers.
http://peterbenjamin.com/seminars/crossplatform/texteol.html#EOL peterbenjamin.com
DOS—uses two characters at the end of the line: <cr><lf>, in that order.
Macintosh—uses one character at the end of the line: <cr>
Unix—uses one character at the end of the line: <lf>
They are different in order to protect copyright privileges. [!]
RFC 959 - File Transfer Protocol faqs.org
3.4. TRANSMISSION MODES
[...]
For the purpose of standardized transfer, the sending host will translate its internal end of line or end of record denotation into the representation prescribed by the transfer mode and file structure, and the receiving host will perform the inverse translation to its internal denotation. An IBM Mainframe record count field may not be recognized at another host, so the end-of-record information may be transferred as a two byte control
code in Stream mode or as a flagged bit in a Block or Compressed mode descriptor. End-of-line in an ASCII or EBCDIC file with no record structure should be indicated by <CRLF> or <NL>, respectively. Since these transformations imply extra work for some systems, identical systems transferring non-record structured text files might wish to use a binary representation and stream mode for the transfer.
Ruby by Example - End-of-Line Conversion mysafaribooksonline.com