[fpc-pascal] CGI file upload

Vannus vannus at gmail.com
Sun May 23 17:57:14 CEST 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20100523/20530258/attachment.html>


More information about the fpc-pascal mailing list