help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Procedures and functions] Reference for unit 'pwumain' (#powtils_main)

IsUpFile

Declaration

Source position: pwumain.pas line 186

function IsUpFile(

  const name: String

):Boolean;

Notes

Checks whether file with associated name (such as html form widget NAME=VALUE pair) has been uploaded.

Example

program upload; {$mode objfpc} {$H+}
uses
  dynpwu, compactsysutils;
const
  FUPL = 'fupl';
begin
  if isupfile(FUPL) then
  begin
    webwrite('<br>');
    webwrite('Upfile name: ' + GetUpFileName(FUPL));
    webwrite('<br>');
    webwrite('Upfile type: ' + GetUpFileType(FUPL));
    webwrite('<br>');
    webwrite('Upfile size: ' +  inttostr(GetUpFileSize('fupl')) );
  end else
  begin
    webwrite('<FORM METHOD=POST ACTION="" enctype="multipart/form-data">' +
             '<input name='+FUPL+' type=file size=20> ' +
             '<br><br>'+
             '<input type=submit>' +
             '</FORM>');
    webwrite('<p>Click to upload file and get info</p>');
  end;
end.






lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505