in reply to Uploading a file

Okay, now I can upload the file, I can wiew it in the browser (if i just print $buffer)
my $FileHandle = $query->param('bild'); print "$filehandle"; open OUTFILE, '>huvudnyhet.jpg' or die "Couldn't open output file: $ +!\n"; while ($Bytes = read($FileHandle,$Buffer,1024)) { $BytesRead += $Bytes; print OUTFILE $Buffer; } warn "Received $BytesRead bytes"; close OUTFILE;
but the file i save is somehow corrupt, i can not open it either in the browswer or in Photoshop. ('Coud not open the document because of a problem parsing the JPEG data'). Suggestions? :) /wonko