On 5/23/2010 08:57, Vannus wrote:
How do you get cgi uploads to work??

Im using TModuledCGIApplication

procedure TCGIDatamodule1.DataModuleCGIRequest(Sender: TObject);
begin
   // upload handling
   writeln('<div>filenamevar:
'+application.requestvariables['file']+'</div>');  // works when get but
post is just blank
   writeln('<div>filenamefile:
'+application.UploadedFileName('file')+'<div>');  // doesn't work with
get or post, just comes out blank

// upload html
   writeln('<form action="'+extractfilename(application.Params[0])+'"
method="post">');
   writeln('Upload File: <input type="file" name="file" /> <input
type="submit" value="Submit"/>');
   writeln('</form>');
end;


TIA
- V

There is an example project (CGI and Apache mod) in Lazarus under /components/fpweb/demo/fptemplate/fileupload/ you can use.

AB

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to