🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #1814

Re: Uploading content of a folder - read timeout error - source code required...

#1814
From: Nicolae Fieraru
Date: Thu, 15 Jul 2004 05:16
72 lines
3490 bytes
Hi Remy,

The code I use is this below. In order to understand what is going on, I
added messages in a Memo for almose every event of the FTP component. I
notice that when it times out, the last message in the Memo is "Status".
You told me that the FTP client is waiting for some acknowledge message from
the server, which never arrives. That might be ok, but I can transfer the
same group of files with CuteFTP. I wonder how did they solve this problem?
And from my tests, the ftp transfer always stops at the same file. I tried
adding an extra file to be uploaded before that one, and it still stops
there. That isn't the only file which causes me problems, in previous tests
it failed with a couple of them.

Regards,
Nicolae

void __fastcall TForm1::btnConnectClick(TObject *Sender)
{
//        IdFTP1->Port = edPort->Text;  //I directly assigned them in the
IdFTP Component
//        IdFTP1->Host = edHost->Text;
//        IdFTP1->Username = edUsername->Text;
//        IdFTP1->Password = edPassword->Text;
        IdFTP->SendBufferSize = 16384; //I decreased this just to test if it
works any better, but it still times out
        IdFTP->Passive = true;
        try
         {
            IdFTP1->Connect( true, 5000 );
         }
        catch(Exception &E)
         {
            ShowMessage( E.Message ); //this show the message "Not
Connected" when Abort() or Quit()
         }
}
//--------------------------------------------------------------------------
-

void __fastcall TForm1::IdFTP1AfterClientLogin(TObject *Sender)
{
  TSearchRec sr;
  int iAttributes = 0;
  iAttributes = faAnyFile;  //here I should remove the faDirectory
  if (FindFirst(edFolder->Text + "\\*", iAttributes, sr) == 0)
  {
    do
    {
      if ((sr.Attr & iAttributes) == sr.Attr)
      {
       if(sr.Name != "." && sr.Name != "..")
        {
          Memo1->Lines->Add("Uploading " + sr.Name);
          IdFTP1->Put(edFolder->Text + "\\" + sr.Name, sr.Name, false );
          Application->ProcessMessages();
          Memo1->Lines->Add("Finished uploading " + sr.Name);
        }
      }
    } while (FindNext(sr) == 0);
    FindClose(sr);
  }
}
//--------------------------------------------------------------------------
-

void __fastcall TForm1::IdFTP1Status(TObject *ASender,
      const TIdStatus AStatus, const AnsiString AStatusText)
{
  Memo1->Lines->Add("Status");
}
//--------------------------------------------------------------------------
-
Technical Details
Message-ID: <40f61327@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40f53800@newsgroups.borland.com> <40f566bf$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,f0221a83e98ee596
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Nicolae Fieraru" <nospam@please.com>
Newsgroups: borland.public.cppbuilder.internet.web
References: <40f53800@newsgroups.borland.com> <40f566bf$1@newsgroups.borland.com>
Subject: Re: Uploading content of a folder - read timeout error - source code required...
Date: Thu, 15 Jul 2004 15:16:20 +1000
Lines: 76
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 203.122.213.16
Message-ID: <40f61327@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1089868583 203.122.213.16 (14 Jul 2004 22:16:23 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail