Mega Search
23.2 Million


Sign Up

Make a donation  
TIdFtp.Get corrupts binary file  
News Group: embarcadero.public.delphi.vcl.components.using

I am using RAD 2010 and trying to Get a dll from a web site.  Using another ftp prog, the dll loads in my calling program with no errors; however, when I use TIDftp.Get with the transferType set to ftBinary, the dll will not load and returns error 998 in the debugger.  When I continue in the debugger I get a message Runtime error 217.  

I have read that there is a bug in this component.  How do I get this method to work?

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 22-Dec-2014, at 8:35 AM EST
From: Alan Jordan
 
Re: TIdFtp.Get corrupts binary file  
News Group: embarcadero.public.delphi.vcl.components.using
Alan wrote:

> It was TYPE A.

That is ASCII mode.  "TYPE I" is binary mode.

> What is the URL for the download?

http://www.indyproject.org/Sockets/Docs/Indy10Installation.EN.aspx

http://www.indyproject.org/Sockets/Download/DevSnapshot.EN.aspx

--
Remy Lebeau (TeamB)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 27-Dec-2014, at 2:49 PM EST
From: Remy Lebeau (TeamB)
 
Re: TIdFtp.Get corrupts binary file  
News Group: embarcadero.public.delphi.vcl.components.using
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> Alan wrote:
> 
> > I have the old component and that doesn't work.  I tried to toggle
> > before and after connect and I still get a corrupted binary file.
> 
> Did you verify that "TYPE A" and "TYPE I" commands are being set to the server 
> each time?
> 
> > I didn't waste a lot of time trying to get a new component, but the
> > last two times I tried a download, I needed a username and password.
> 
> Indy releases are not password-protected.
> 
> --
> Remy Lebeau (TeamB)

It was TYPE A.  

What is the URL for the download?

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 27-Dec-2014, at 1:30 PM EST
From: Alan Jordan
 
Re: TIdFtp.Get corrupts binary file  
News Group: embarcadero.public.delphi.vcl.components.using
Alan wrote:

> I have the old component and that doesn't work.  I tried to toggle
> before and after connect and I still get a corrupted binary file.

Did you verify that "TYPE A" and "TYPE I" commands are being set to the server 
each time?

> I didn't waste a lot of time trying to get a new component, but the
> last two times I tried a download, I needed a username and password.

Indy releases are not password-protected.

--
Remy Lebeau (TeamB)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 27-Dec-2014, at 11:31 AM EST
From: Remy Lebeau (TeamB)
 
Re: TIdFtp.Get corrupts binary file  
News Group: embarcadero.public.delphi.vcl.components.using
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> Alan wrote:
> 
> > I have a work around for this. It's not efficient, but what works is
> > to have two components, one for ASCII files and one for binary.
> > Not elegant, or efficient, but works and saves an upgrade.
> 
> You don't need two components.  You can freely toggle the TransferType property 
> between ASCII and Binary on a per-transfer basis as needed.
> 
> --
> Remy Lebeau (TeamB)
I have the old component and that doesn't work.  I tried to toggle before and after connect and I still get a corrupted binary file.  I didn't waste a lot of time trying to get a new component, but the last two times I tried a download, I needed a username and password.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 27-Dec-2014, at 8:51 AM EST
From: Alan Jordan
 
Re: TIdFtp.Get corrupts binary file  
News Group: embarcadero.public.delphi.vcl.components.using
Alan wrote:

> I have a work around for this. It's not efficient, but what works is
> to have two components, one for ASCII files and one for binary.
> Not elegant, or efficient, but works and saves an upgrade.

You don't need two components.  You can freely toggle the TransferType property 
between ASCII and Binary on a per-transfer basis as needed.

--
Remy Lebeau (TeamB)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 26-Dec-2014, at 3:15 PM EST
From: Remy Lebeau (TeamB)
 
Re: TIdFtp.Get corrupts binary file  
News Group: embarcadero.public.delphi.vcl.components.using
> {quote:title=Alan Jordan wrote:}{quote}
> I am using RAD 2010 and trying to Get a dll from a web site.  Using another ftp prog, the dll loads in my calling program with no errors; however, when I use TIDftp.Get with the transferType set to ftBinary, the dll will not load and returns error 998 in the debugger.  When I continue in the debugger I get a message Runtime error 217.  
> 
> I have read that there is a bug in this component.  How do I get this method to work?

I have a work around for this. It's not efficient, but what works is to have two components, one for ASCII files and one for binary.  Not elegant, or efficient, but works and saves an upgrade.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 26-Dec-2014, at 1:35 PM EST
From: Alan Jordan
 
Re: TIdFtp.Get corrupts binary file  
News Group: embarcadero.public.delphi.vcl.components.using
Alan wrote:

> I have read that there is a bug in this component.

If I had to guess, you are likely suffering from the same problem described 
in the following discussion thread:

IdFTP changing data size after upload
http://forums2.atozed.com/viewtopic.php?f=7&t=5631

Make sure you are using an up-to-date version of Indy so you have the latest 
bug fixes.

--
Remy Lebeau (TeamB)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 22-Dec-2014, at 9:47 AM EST
From: Remy Lebeau (TeamB)