Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Websnap, File Upload (https://www.delphipraxis.net/175734-websnap-file-upload.html)

FrankJ28 12. Jul 2013 14:42

Websnap, File Upload
 
Hallo Wissende,
weiß jemand wie man via WebSnap einen Datei-Upload umsetzen kann? Basis ist ein Form

enctype="multipart/form-data"

und das zugehörige Input type="file"

Wie bekomme ich das File in meine WebSnap-DLL zur Weiterverarbeitung?
Danke für eure Ideen
Ciao
Frank

FrankJ28 14. Jul 2013 17:07

AW: Websnap, File Upload
 
Niemand eine Idee?
(Push)

FrankJ28 16. Jul 2013 12:29

AW: Websnap, File Upload
 
Hallo,
manchmal sieht man den Wald vor lauter Bäumen nicht, der Request hat das Zeug schon im Bauch.
Hier ein wenig Beispielcode:

Delphi-Quellcode:
 if Request.Files.Count>0
    then begin
          myFileBuffer:=TMemoryStream.Create;
          try
           myFileBuffer.LoadFromStream(Request.Files.Items[0].Stream);
           myFileBuffer.SaveToFile('c:\temp\'+ExtractFileName(Request.Files.Items[0].FileName));
          finally
           myFileBuffer.Free;
          end;
         end;
Ciao
Frank


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:40 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