Error Handling in synchronous mode

Check also Multipart Multithreaded Downloading

procedure TfmTestDownloader.btDownLoadClick(Sender: TObject);   
begin   
   clDownloader1.URL := 
        'http://www.clevercomponents.com/images/testimage.jpg';   
   clDownloader1.LocalFolder := 'c:\downloads';   
   clDownLoader1.Start(False);   
 
   case clDownLoader1.ResourceState.LastStatus of   
      psSuccess: ShowMessage('Process completed successfully');   
      psFailed: ShowMessage((Sender as TclDownLoader).Errors.Text);   
      psTerminated: ShowMessage('Process stopped');   
      psErrors: ShowMessage('Process completed with some warnings');   
   end;   
end;  

Add Feedback