Delphi-PRAXiS
Seite 2 von 2     12   

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)

generic 19. Apr 2010 16:45

Re: Clac CRC before downloading
 
Look here:
http://en.wikipedia.org/wiki/HTTP_ETag
the german one is better:
http://de.wikipedia.org/wiki/HTTP_ETag
and
http://solariz.de/2044/etag_webseite...chleunigen.htm

Depending on the Webserver you have a strong Etag or not.
Strong ETags using checksums.
Weak ETags you can detect on "W/" before the Etag-Code.
last link uses php code for MD5-Etaging

Delphi-Quellcode:
uses
  MSXML2_TLB;

var
  req : IXMLHTTPRequest;
  str_link: string;
begin
  req := CoXMLHTTP40.Create;
  str_link:='http://linktofile';
  req.Open('HEAD', str_link, False, EmptyParam, EmptyParam);
  req.send(EmptyParam);
  // check for req.status=200 -> if true no error
  MessageDlg(req.getAllResponseHeaders(), mtWarning, [mbOK], 0);
  MessageDlg(req.getResponseHeader('Etag'), mtWarning, [mbOK], 0);

  req:=nil;
end;

the headers may look like:
Code:
Date   Mon, 19 Apr 2010 15:45:57 GMT
Server   Apache
Pragma   public
Expires   Mon, 19 Apr 2010 16:34:07 GMT
Last-Modified   Mon, 19 Apr 2010 15:34:07 GMT
Cache-Control   max-age=2890, public, must-revalidate, proxy-revalidate Vary   Accept-Encoding,Cookie,User-Agent
Etag   7e828ab2622e112d6a6bd3b7083a560b
Content-Encoding   gzip
Content-Type   text/html; charset=UTF-8

SirThornberry 19. Apr 2010 17:06

Re: Clac CRC before downloading
 
@sdean: please dont push within 24 hours. If you want to add any information during this time, you can use the edit-button at the top of your last entry.

sdean 19. Apr 2010 17:24

Re: Clac CRC before downloading
 
@SirThornberry : Sorry for that


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:29 Uhr.
Seite 2 von 2     12   

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