|
Posted by Bent Stigsen on 03/14/06 13:09
greg wrote:
[snip]
> Thank you for these explanations.
> In fact, I should have told why I want know make the difference between
> ascii and binary files.
> I have a list of files to send via FTP from a local machien to a remote
> server.
> the ftp_put function needs an argument that can be FTP_ASCII or FTP_BINARY.
> I don't know how to choose dynamicaly this argument as the must upload
> various file types.
The only purpose of ascii transfer is to translate line-endings
(CR,LF,CRLF) between differing systems, but many text-editors can
handle any type, so always using binary as Kimmo suggest is a good
option, since this leaves files intact, whereas using ascii by mistake
could render a file useless.
Although I would think that to use ascii-transfer if and only if file
has an extension of ".txt" should be safe.
/Bent
Navigation:
[Reply to this message]
|