aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatthew <matthew>2009-12-09 18:08:04 +0000
committermatthew <matthew>2009-12-09 18:08:04 +0000
commit112afd81c6627281cca9a1ba08540c458f6fc326 (patch)
treef07ab78852f688e49da2828b955a6ed6de7df5f2
parent946fa4ef1b262efb23bbe1169378cfdd65b45f99 (diff)
Fetching the filehandle must come before outputting a header. If anyone
can tell me why this is so, I'm all ears.
-rwxr-xr-xweb/import.cgi4
1 files changed, 2 insertions, 2 deletions
diff --git a/web/import.cgi b/web/import.cgi
index b2fb3d798..92d3a9c2e 100755
--- a/web/import.cgi
+++ b/web/import.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: import.cgi,v 1.9 2008-12-11 15:18:44 matthew Exp $
+# $Id: import.cgi,v 1.10 2009-12-09 18:08:04 matthew Exp $
use strict;
use Error qw(:try);
@@ -29,9 +29,9 @@ sub main {
return;
}
+ my $fh = $q->upload('photo'); # MUST come before $q->header, don't know why!
print $q->header(-charset => 'utf-8', -content_type => 'text/plain');
- my $fh = $q->upload('photo');
if ($fh) {
my $err = Page::check_photo($q, $fh);
push @errors, $err if $err;