The same happens when a file is downloaded from the server to the client: the server makes sure the line endings are CR+LF when sending the file and the client then strips away whatever is not needed as line ending on its platform.īecause the file is changed if client and server are not running on the same kind of platform, this data type cannot be used for files with arbitrary characters, so called binary files, like images and videos. If it is Microsoft Windows, nothing has to be removed, while on Unix the superfluous CR is removed and on legacy MacOS the unneeded LF. The server then adjusts the line ending again to what is used on the platform the server runs at. Therefore it has to add nothing (on Microsoft Windows), add CR (on Unix) or add LF (on legacy MacOS) to each line ending. So in case the file is transferred from the client to the server, the client has to make sure CR+LF is used. According to the FTP specification, ASCII files are always transferred using a CR+LF pair as line ending. The purpose of ASCII type is to ensure that line endings are properly changed to what is right on the platform. Microsoft Windows for example uses a CR+LF pair (carriage return and line feed), while Unix(-like) systems, including Linux and MacOS X, only use LF and traditional MacOS systems (MacOS 9 or older) only use CR. The problem with text files is that different platforms have different kinds of line endings. binary (called "image" in the specification)īut most of the time, however, only ASCII and binary types are used or even implemented.ĪSCII type is used to transfer text files.The FTP specification ( RFC 959) calls them "data type", but they are commonly referred to as "transfer mode", even though this is not correct. Files can be transferred between an FTP client and server in different ways.
0 Comments
Leave a Reply. |