Hi !!

In my application, I am downloading one file to my application path.Some times it is not downloading total file.In that my application is crashing.

For that I want to download that file to another place.If it is dowloaded correctly,then it is to copy to my application path.
For downloading,I wrote the code as follows....

int createFileMask = CFile::modeCreate | CFile::modeWrite | CFile::typeBinary;
CFile destFile(strDestFile,createFileMask );
while(byteswrite = pTargFile->Read(filebuf,512)){
destFile.Write(filebuf, byteswrite);
}
// Download ended, close file
destFile.Close();
Can any one please give me the solution for this problem..
And can I use the CopyFileEx method to solve this??If, How can I use this function..

Thanks & Regards,
klvin.