Title: Clever Downloader Internet Components
Question: download the Internet-resources asynchronously
Answer:
Version 1.0
1. Do I need Clever Downloader suite?
2. Some technical information
3. Demo version information
Do I need Clever Downloader suite?
The suite of the Clever Downloader Internet components presents you the most efficient and convenient way to access the Internet resources from your applications.
These components allow you to download the Internet-resources asynchronously and obtain all the necessary information about them without interfering the main application processes. It is achieved by using the engine of separate threads.
Due to using the wait engine mechanism the timeout feature in the wininet library is improved.
The set of components properties allow you to adjust their performance beginning with the Internet-resource (URL) up to the temporary downloading buffer settings.
The advanced events system provides the mechanism of flexible control over downloading the Internet resources.
The library includes both the component for operation with a single resource and the component for processing several resources simultaneously. The Interface uniformity will help you to switch between two components promptly.
The suite also contains the component for checking new resources at your web-server. It allows you to check if the specified resource is relatively up-to-date to the previously downloaded and to download a new one if it is necessary. The process of checking, downloading and displaying can be customized by defining the events sequence.
The reasons why you may need the Clever Downloader suite include
- This Suite can make your application more friendly for end-users by adding downloading features to them
- If you want your application to check and receive updates without bothering the end-user
- If you want automatically inform the end-user about the latest resources available on your server
And many other motives
Impressed?
Just get the Clever Downloader suite and enjoy it!
Some technical information
The interface of the components was designed to help you to develop your software rapidly with minimum coding.
The main properties of Clever Downloader suite components include:
The Priority property that determines the download item scheduling priority relative to other items. It allows your application to be more responsible during downloading process.
The DownLoadList property that allows you to define the list of resources to download at design and runtime.
The ResourceInfo run-time property that provides information about the downloaded resource. This property allows you to access additional information about the resource:
procedure TDownLoaderTest.clDownLoaderGetResourceInfo(AItem: TclDownLoadItem);
begin
if (AItem.ResourceInfo nil) then
begin
memInfo.Lines.Add('Resource ' + AItem.ResourceInfo.Name);
memInfo.Lines.Add('Size ' + IntToStr(AItem.ResourceInfo.Size));
memInfo.Lines.Add('Date ' + DateTimeToStr(AItem.ResourceInfo.Date));
memInfo.Lines.Add('Type ' + AItem.ResourceInfo.ContentType);
end else
begin
memInfo.Lines.Add('There are no any info available.');
end;
end;
The number of events, such as OnDataItemProceed, OnDownLoadEvent, OnError and so on that allow you to get the detailed information about the downloading process.
procedure TDownLoaderTest.clDownLoaderDataItemProceed(Sender: TObject;
ResourceInfo: TclResourceInfo; BytesProceed: Integer; CurrentData: PChar;
CurrentDataSize: Integer);
var
s: string;
begin
s := IntToStr(BytesProceed);
if (ResourceInfo nil) then
begin
s := s + ' of ' + IntToStr(ResourceInfo.Size);
end;
end;
When download or get resource info process is started, the OnURLParsed event occurs. This event can be used to get the detailed information about the URL or to substitute the appropriate URL members.
procedure TDownLoaderTest.clDownLoaderURLParsed(Sender: TObject;
URLComponents: TURLComponents);
begin
memInfo.Lines.Clear();
with URLComponents do
begin
memInfo.Lines.Add('Scheme: ' + lpszScheme);
memInfo.Lines.Add('Host: ' + lpszHostName);
memInfo.Lines.Add('User: ' + lpszUserName);
memInfo.Lines.Add('Path: ' + lpszUrlPath);
memInfo.Lines.Add('Extra: ' + lpszExtraInfo);
end;
end;
The OnIsNews event of the TclNewsChecker component occurs on downloading the news resource. Write this event handler to redefine the algorithm which is used to determine whether the downloaded resource is up-to-date.
procedure TDownLoaderTest.clNewsCheckerIsNews(Sender: TObject; var IsNews, Handled: Boolean);
var
NewsFileName: string;
begin
NewsFileName := (Sender as TclNewsChecker).SaveToFile; //file name of the resource to download
IsNews := not FileExists(NewsFileName); //if the file does not exist it will be downloaded
Handled := True; //the default resource checking will not be performed
end;
Additionally, you can set some service options such as the output folder name (SaveToFolder property), TimeOut (in milliseconds) and the number of characters displayed in the preview (PreviewCharCount property).
Download demo version here.
The shipping includes installations for Delphi 3, Delphi 4, Delphi 5, Delphi 6 and Borland C Builder 4 & 5. The help system for all components and Demo-programs are also installed.
For more details please contact info@clevercomponents.com.