AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Clac CRC before downloading
Thema durchsuchen
Ansicht
Themen-Optionen

Clac CRC before downloading

Ein Thema von sdean · begonnen am 19. Apr 2010 · letzter Beitrag vom 19. Apr 2010
Antwort Antwort
Seite 1 von 2  1 2      
sdean

Registriert seit: 5. Dez 2009
64 Beiträge
 
#1

Clac CRC before downloading

  Alt 19. Apr 2010, 15:22
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 ? .
  Mit Zitat antworten Zitat
Benutzerbild von wicht
wicht

Registriert seit: 15. Jan 2006
Ort: Das schöne Enger nahe Bielefeld
809 Beiträge
 
Delphi XE Professional
 
#2

Re: Clac CRC before downloading

  Alt 19. Apr 2010, 15:26
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
http://streamwriter.org

"I make hits. Not the public. I tell the DJ’s what to play. Understand?"
  Mit Zitat antworten Zitat
sdean

Registriert seit: 5. Dez 2009
64 Beiträge
 
#3

Re: Clac CRC before downloading

  Alt 19. Apr 2010, 15:40
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 ?
  Mit Zitat antworten Zitat
Benutzerbild von lbccaleb
lbccaleb

Registriert seit: 25. Mai 2006
Ort: Rostock / Bremen
2.037 Beiträge
 
Delphi 7 Enterprise
 
#4

Re: Clac CRC before downloading

  Alt 19. Apr 2010, 15:47
You can also check the Filesize before downloading the file!
Martin
MFG Caleb
TheSmallOne (MediaPlayer)
Die Dinge werden berechenbar, wenn man die Natur einer Sache durchschaut hat (Blade)
  Mit Zitat antworten Zitat
sdean

Registriert seit: 5. Dez 2009
64 Beiträge
 
#5

Re: Clac CRC before downloading

  Alt 19. Apr 2010, 15:53
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
  Mit Zitat antworten Zitat
Benutzerbild von lbccaleb
lbccaleb

Registriert seit: 25. Mai 2006
Ort: Rostock / Bremen
2.037 Beiträge
 
Delphi 7 Enterprise
 
#6

Re: Clac CRC before downloading

  Alt 19. Apr 2010, 16:00
I have found this. But its only german.
Martin
MFG Caleb
TheSmallOne (MediaPlayer)
Die Dinge werden berechenbar, wenn man die Natur einer Sache durchschaut hat (Blade)
  Mit Zitat antworten Zitat
Benutzerbild von HeikoAdams
HeikoAdams

Registriert seit: 12. Jul 2004
Ort: Oberfranken
661 Beiträge
 
FreePascal / Lazarus
 
#7

Re: Clac CRC before downloading

  Alt 19. Apr 2010, 16:04
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.
Jeder kann ein Held werden und Leben retten!
Einfach beim NKR oder der DKMS als Stammzellenspender registrieren! Also: worauf wartest Du noch?
  Mit Zitat antworten Zitat
generic

Registriert seit: 24. Mär 2004
Ort: bei Hannover
2.415 Beiträge
 
Delphi XE5 Professional
 
#8

Re: Clac CRC before downloading

  Alt 19. Apr 2010, 16:16
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.
Coding BOTT - Video Tutorials rund um das Programmieren - https://www.youtube.com/@codingbott
  Mit Zitat antworten Zitat
sdean

Registriert seit: 5. Dez 2009
64 Beiträge
 
#9

Re: Clac CRC before downloading

  Alt 19. Apr 2010, 16:22
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 ?
  Mit Zitat antworten Zitat
sdean

Registriert seit: 5. Dez 2009
64 Beiträge
 
#10

Re: Clac CRC before downloading

  Alt 19. Apr 2010, 16:24
Thank you generic, could you explain more , or give me a little exemple for that
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2      


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:15 Uhr.
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