![]() |
Bild aus Resource mit IdHTTPServer ohne Temporärdatei?
Wie bekomme ich ein Bild aus einer Resource ohne eine Temporärdatei zum Client?
Bisher mache ich es so:
Delphi-Quellcode:
Allerdings passiert es dabei schonmal, dass der Server zu langsam ist und die Datei schon gelöscht ist ist bevor sie gestreamt wurde.
AResponseInfo.ContentType := 'image/jpeg';
try RS := TResourceStream.Create(0, 'background', RT_RCDATA); RS.Position := 0; TmpFile := GetTempFile; RS.SaveToFile(TmpFile); IdHTTPServer1.ServeFile(AThread, AResponseInfo, TmpFile); try DeleteFile(TmpFile); except end; finally RS.Free; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:41 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz