Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

A question about Indy Component

- - - - -

  • Please log in to reply
No replies to this topic

#1
echap2000

echap2000

    Junior

  • Member
  • Pip
  • 61 posts
  • Joined 18-October 03
I installed Indy Component version 9.X

I would like to download a file by using IdHTTP ..

So, here is my code

  TFileStream *f; 


   try 
   { 
      f = new TFileStream (destination.c_str(), fmCreate ); 
      IdHTTP->Get("http://forumgold.Da.Ru/file.exe",f); 

   } 
   __finally 
   { 
      f->Free(); 

   }


There is no problem for that.. Let's imagine a big file. about 100 mb.. And suppose, you want to cancel the downloading.

I tried all functions->
IdHTTP->CancelWriteBuffer();
IdHTTP->CloseWriteBuffer();
IdHTTP->Destroying();
IdHTTP->Disconnect();
IdHTTP->DisconnectSocket();
IdHTTP->EndWork (wmRead);


They didn't work. Because, when I click to download again : IdHttp's functions : Work and WorkBegin aren't called.
I think, no one of this commands (see above) cancels the downloading.

Any ideas?


How to remove advertisement from MSFN



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users