1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
<html>
<head>
<title>Embperl Tests - File-Upload</title>
</head>
<h1>Embperl Tests - File-Upload</h1>
[+ do { $cgiok = $CGI::VERSION > 2.45 ; @info = sort keys %{$fdat{-upload}} ; $cgiok?"@info":'Content-Disposition Content-Type' } +]
Filename: [+ $cgiok?$fdat{upload}:'upload-filename' +]<br>
Content-Type: [+ $cgiok?$fdat{-upload} -> {'Content-Type'}:'test/plain' +]<br>
CGI-Version: [+ $CGI::VERSION +]
cgiok [+ $cgiok +]
[-
$buf .= $buffer while read($fdat{upload}, $buffer, 32768);
-]
Your file has been the content
----------
[+ $buf +]
----------
<hr>
content: [+ $fdat{content} +] <br>
multval: [+ join (';', split ("\t", $fdat{multval})) +] <br>
single: [+ $fdat{single} +] <br>
<br>
[#
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' } +]
#]
<p><hr>
<small>HTML::Embperl (c) 1997-1998 G.Richter</small>
</body>
</html>
|