Autor Beitrag
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mi 05.10.05 20:14 
Hi, ich will runtergeladene Bilder mit denen im Web nach Datum vergleichen aber
es wird mir immer 30.12.1899 02:00:00 geliefert, und wenn eine Bilddatei runter-
geladen wurde möchte ich dasselbe Datum setzen wie im Web die Bilddatei!
Aber funzt irgendwie nicht!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
function TMainForm.FieldGetWebData(const URL: String): String;
var HTTP : TIdHTTP;
    Mem : TFileStream;
    S : String;
    FE : Boolean;
begin
    // wenn Datei nicht vorhanden dann laden
    S := ApplicationDirectory+'\Temp\'+ExtractFileNameFromURL(URL);
    HTTP := TIdHTTP.Create(Self);
    FE := FileExists(S);
    HTTP.Get(URL);   // muß hier Get als auch
    HTTP.Head(URL);  // Head aufgerufen werden?
    if(not FE) or ((FE) and (FileAge(S) <> DateTimeToFileDate(HTTP.Response.LastModified)))then
    begin
    Mem := TFileStream.Create(S, fmCreate);
    HTTP.Get(URL, Mem);
    Mem.Free;                                                        
    FileSetDate(S, DateTimeToFileDate(HTTP.Response.LastModified)); // muß ich hier wieder Head aufrufen? ansonsten Speichere ich beim 
    end;                                                            // ersten aufruf von Head das Datum
    HTTP.Free;
    Result := S;
end;


Bitte, wer weiß rat?
tomtom62
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 278

WIN 2000, XP prof
D5 prof.
BeitragVerfasst: Mi 05.10.05 20:29 
Ich würde mal vermuten, das entspricht dem Wert 0 für das Datum. Hilft dir das eventuell weiter ?

Thomas
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mi 05.10.05 20:46 
user profile icontomtom62 hat folgendes geschrieben:
Ich würde mal vermuten, das entspricht dem Wert 0 für das Datum. Hilft dir das eventuell weiter ?

Thomas


Ja das habe ich mir auch schon gedacht nur wie kann ich's ändern?