Mega Search
23.2 Million


Sign Up

Make a donation  
TIdFTP.TransferType defaults to ftASCII  
News Group: embarcadero.public.delphi.internet.winsock

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.  The old documentation I have says this is the default.

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.

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 25-Nov-2014, at 10:20 PM EST
From: Ross Levis
 
Re: TIdFTP.TransferType defaults to ftASCII  
News Group: embarcadero.public.delphi.internet.winsock
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)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 26-Nov-2014, at 10:58 AM EST
From: Remy Lebeau (TeamB)