summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/attachment.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin/attachment.pm')
-rw-r--r--IkiWiki/Plugin/attachment.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
index 90e0f0f0b..f4f64b46a 100644
--- a/IkiWiki/Plugin/attachment.pm
+++ b/IkiWiki/Plugin/attachment.pm
@@ -133,7 +133,11 @@ sub formbuilder (@) { #{{{
else {
my $fh=$q->upload('attachment');
if (! defined $fh || ! ref $fh) {
- error("failed to get filehandle");
+ # needed by old CGI versions
+ $fh=$q->param('attachment');
+ if (! defined $fh || ! ref $fh) {
+ error("failed to get filehandle");
+ }
}
binmode($fh);
writefile($filename, $config{srcdir}, undef, 1, sub {