[! use Data::Dumper ; !]

Embperl Tests - File-Upload

[+ do { $cgiok = $CGI::VERSION > 2.45; $cgi4 = $CGI::VERSION >= 4; @info = sort keys %{$fdat{-upload}} ; ($cgiok||$cgi4)?"@info":'Content-Disposition Content-Type' } +] Filename: [+ $cgiok?$fdat{upload}:'upload-filename' +]
Content-Type: [+ $cgiok?$fdat{-upload} -> {'Content-Type'}:'test/plain' +]
CGI-Version: [+ $CGI::VERSION +] cgiok [+ $cgiok +] filehandle: [+ ref $fdat{upload} +] Info: [+ join ("\n", map { "$_ = $fdat{-upload}{$_}" } sort keys %{$fdat{-upload}}) +] [- $no = 1 ; while ($size = read($fdat{upload}, $buffer, 2048)) { $buf .= $buffer ; print OUT 'no: ', $no++, "\n" ; print OUT 'size: ', $size, "\n" ; } -] buflen: [+ length($buf) +] Your file has the content ---------- [+ $buf +] ----------
content: [+ $fdat{content} +]
multval: [+ join (';', split ("\t", $fdat{multval})) +]
single: [+ $fdat{single} +]

[# eval 'use IO::Handle' ; $h = undef ; eval '$h = IO::Handle -> new_from_fd (fileno ($fdat{upload}), "r")' ; -] [+ if ($h) { @s = $h -> stat ; $s[7]} else { '8219' } +] #]


HTML::Embperl (c) 1997-1998 G.Richter