Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7168435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:46:47+00:00 2026-05-28T14:46:47+00:00

I have two string lists: name (contains file names), url (contains file urls). I

  • 0

I have two string lists: name (contains file names), url (contains file urls).
I would like to download all neccessary files using THttpget in one loop, with a progress bar:

for d:=0 to numberOfDownloads-1 do
begin
HTTPGet2.URL:=url[d];
HTTPGet2.FileName:=name[d];
HTTPGet2.GetFile;
end;

It works, but it downloads only one file – first on the string list.
How can I do that?
numberOfDownloads – number of items in the stringlist name.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:46:48+00:00Added an answer on May 28, 2026 at 2:46 pm

    HTTPGet downloads a file asynchronously, by creating a secondary thread and notifying thru standard events.

    So, in your case, when you iterate over the loop and get to the second file to download, the HTTPGet2 instance is still busy processing the previous download.

    One simple way to overcome this is to create an array of HTTPGet instances… something like this…

     var HTTPGets: array of THttpGet;
       ...
     setlength(HTTPGets,numberOfDownloads);
     ...
     for d:=0 to numberOfDownloads-1 do
       begin
        HTTPGets[d]:=THttpGet.Create(...);
        HTTPGets[d].URL:=...;
         ...
        HTTPGets[d].GetFile;
       end;
     end.
    

    and to get notified of the finalization events, you need to create your own OnDoneFile and set it…

       HTTPGets[d].OnDoneFile:=HTTPGetOnDone;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two lists. The first contains names (string) the second contains filters (object).
I have two tables with lists of files: table1 has column1 with file names
I have a list like this Dim emailList as new List(Of String) emailList.Add(one@domain.com) emailList.Add(two@domain.com)
I have two string variables which are both file paths. The code that worked
I have a text file that lists the names of a large number of
I have a List<string> sampleList which contains Data1 Data2 Data3... The file structure is
Question is simple: I have two List List<String> columnsOld = DBUtils.GetColumns(db, TableName); List<String> columnsNew
I have two complex (i.e. objects with string, int, double, List and other home
I have two String.printable mysteries in the one question. First, in Python 2.6: >>>
I have two String arrays a,b. String a [] = {one,two,three}; String b []

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.