TIdFTP.TransferType defaults to ftASCII |
|
Re: TIdFTP.TransferType defaults to ftASCII |
|
Ross wrote:
> I'm not sure if this just happened after updating to the latest Indy
> 10 build or not but I discovered the TransferType property is
> defaulting to ftASCII when I'm sure it use to default to ftBinary.
That change was intentionally made back in 2008 (SVN revision 2880). ASCII
is the default transfer type of the FTP protocol. It was a bug that TIdFTP
defaulted to binary instead, so it was fixed to match the FTP spec.
> The old documentation I have says this is the default.
The documentation is old - period. It has not been updated in a long time,
unfortunately.
> I wasn't specifying the TransferType previously and it was working
> fine downloading MP3 files which played fine. Now the files don't
> play, but do again now that I specify ftBinary. Just thought I would
> bring it up in case a fix is needed.
You should always set the TransferType to the desired value before every
transfer (or at least before a batch of transfers if all of the files in
the batch use the same TransferType). TIdFTP keeps track of the current
TransferType so it sends TYPE commands to the server only when the type actually
changes.
--
Remy Lebeau (TeamB)
|