summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-01-12 13:56:07 +0100
committerYorhel <git@yorhel.nl>2011-01-12 13:56:07 +0100
commitd2acc91aaf6521b81c4083b7fc7efeb8530939af (patch)
treee8779f7c4f854c8b7795065777cadb00212ac5f5 /examples
parent4e900c8f3de70eb037e8b15c1173b80d29cf5518 (diff)
Added file upload info to examples/MyWebsite/InfoDump.pm
Diffstat (limited to 'examples')
-rw-r--r--examples/MyWebsite/InfoDump.pm22
1 files changed, 21 insertions, 1 deletions
diff --git a/examples/MyWebsite/InfoDump.pm b/examples/MyWebsite/InfoDump.pm
index 50280d3..8950150 100644
--- a/examples/MyWebsite/InfoDump.pm
+++ b/examples/MyWebsite/InfoDump.pm
@@ -47,6 +47,12 @@ sub info {
$tr->($_, join "\n---\n", $self->reqPOST($_)) for ($self->reqPOST());
end;
+ h2 'Uploaded files';
+ table;
+ thead; Tr; td 'Name'; td 'File size - File name - Mime type'; end; end;
+ $tr->($_, length($self->reqUploadRaw($_)).' - '.$self->reqPOST($_).' - '.$self->reqUploadMIME($_)) for ($self->reqUploadMIME());
+ end;
+
h2 'HTTP Headers';
table;
thead; Tr; td 'Header'; td 'Value'; end; end;
@@ -87,7 +93,7 @@ sub forms {
form method => 'POST', action => '/info';
for (0..5) {
input type => 'checkbox', name => 'checkbox', value => $_, id => "checkbox_$_", $_%2 ? (checked => 'checked') : ();
- label for => "checkthing_$_", "checkbox $_";
+ label for => "checkbox_$_", "checkbox $_";
}
br;
label for => 'text', 'Text: ';
@@ -97,6 +103,20 @@ sub forms {
input type => 'submit';
end;
+ h2 'POST (multipart)';
+ form method => 'POST', action => '/info', enctype => 'multipart/form-data';
+ for (0..5) {
+ input type => 'checkbox', name => 'check', value => $_, id => "check_$_", $_%2 ? (checked => 'checked') : ();
+ label for => "check_$_", "check $_";
+ }
+ br;
+ label for => 'file1', 'File 1: '; input type => 'file', name => 'file1', id => 'file1';
+ br;
+ label for => 'file2', 'File 2: '; input type => 'file', name => 'file2', id => 'file2';
+ br;
+ input type => 'submit';
+ end;
+
end;
end;
}