Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Clac CRC before downloading (https://www.delphipraxis.net/150512-clac-crc-before-downloading.html)

sdean 19. Apr 2010 15:22


Clac CRC before downloading
 
Hi , i use indy 'idhttp' to download files , But what i want is :

Before begin downloading a file from server i should calc its CRC why :
because i must be sure if this file has not already been downloaded and saved .

please is there any way or other alternative to acheive that ? .

wicht 19. Apr 2010 15:26

Re: Clac CRC before downloading
 
Hi,

this might not be possible because you can calculate the CRC only if you already downloaded the file I think. Is this over HTTP? I think there is no HTTP command to get the checksum of a remote file.

HTH

sdean 19. Apr 2010 15:40

Re: Clac CRC before downloading
 
yes over HTTP , let me suppose the following scenario :

yesterday i downloaded x0.myfile which CRC is 3361685294 , and today i want to download other files among of them is x0.myfile so when the download process starts it should bypass x0.myfile because it's already downloaded yesterday .

That's what i want to acheive .

Yes i can use If FileExists(x0.myfile) then bypass , But here i want to work with CRC , MD5 or whatever


any idea wicht ?

lbccaleb 19. Apr 2010 15:47

Re: Clac CRC before downloading
 
You can also check the Filesize before downloading the file!

sdean 19. Apr 2010 15:53

Re: Clac CRC before downloading
 
Thank you lbccaleb :

But it can be possible 2 files have the same size !

I think the better way is to use the CRC or MD5

lbccaleb 19. Apr 2010 16:00

Re: Clac CRC before downloading
 
I have found this. But its only german.

HeikoAdams 19. Apr 2010 16:04

Re: Clac CRC before downloading
 
Is the file you want to download a file provided by you? If yes you could also provide a textfile containing the checksum of that file which will be downloaded first. After that you could download the main-file and compare its checksum with the checksum from your textfile.

IMHO there is no way to calc a checksum of a file placed on a webserver without downloading that file to your local computer.

generic 19. Apr 2010 16:16

Re: Clac CRC before downloading
 
you cant build a crc on a url without downloading the file!

but you can request via HEAD the headers to a file.
with the header you can compare the size, date and most important the Etag.

sdean 19. Apr 2010 16:22

Re: Clac CRC before downloading
 
Thank you HeikoAdams , that's a good idea , Ok then let me suppose this :

i place an ini file in my webserver :
update.ini

[File01]
Name=x0.myfile
checksum=3361685294
[File02]
Name=x1.myfile
checksum=3361685295
.
.
.

Then should i download x0.myfile to compare its checksum with the already downloaded one or what ?

sdean 19. Apr 2010 16:24

Re: Clac CRC before downloading
 
Thank you generic, could you explain more , or give me a little exemple for that


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:20 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz