Upload file using Delphi CGI
Could anyone please give a working example of how to upload a file using Delphi CGI.
I have googled but so far haven't had any luck.
This is what I have been trying but I am getting access violations.
procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); var lFileName : string; lFileStream : TFileStream; begin lFileName := Request.Files.FileName; lFileStream := TFileStream.Create(lFileName, fmCreate); try lFileStream.CopyFrom(Request.Files.Stream, Request.Files.Stream.Size); finally lFileStream.Free; end; end;
No correct solution
Use idRunner components that you can find at:
They are free and include source code so you can adapt them.
I've used the code from the following link to make my webbroker stuff do (multi-)file uploads.
The site has a lot of information on how to do things with the webbroker technology.