uses sysutils,dateutils; var s:string; c:char; f:text; dt:tdatetime; begin writeln('Status: 200 Ok'); s:=getEnvironmentVariable('REQUEST_METHOD'); if s='GET' then begin writeln('Content-type: text/html; charset=utf-8'); writeln(); writeln('
'); end else begin writeln('Content-type: text/plain; charset=utf-8'); writeln(); assign(f,'/opt/test/1.dat'); dt:=now(); rewrite(f); while not eof do begin read(c); write(f,c); end; close(f); writeln('work time = ',millisecondsbetween(now(),dt)); s:=getEnvironmentVariable('CONTENT_LENGTH'); writeln('file loaded, len=',s); s:=getEnvironmentVariable('CONTENT_TYPE'); writeln('type=',s); end; end.