Thread Perl Upload Script (27 answers)
Opened by willy168 at 2011-08-09 10:40

kristian
 2011-08-10 11:07
#151445 #151445
User since
2005-04-14
684 Artikel
BenutzerIn
[Homepage] [default_avatar]
Grummel

READ THIS:

Quote
PROCESSING A FILE UPLOAD FIELD Basics

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
$lightweight_fh = $q->upload('field_name');

# undef may be returned if it's not a valid file handle
if (defined $lightweight_fh) {
   # Upgrade the handle to one compatible with IO::Handle:
   my $io_handle = $lightweight_fh->handle;

   open (OUTFILE,'>>','/usr/local/web/users/feedback');
   while ($bytesread = $io_handle->read($buffer,1024)) {
      print OUTFILE $buffer;
   }
}

Last edited: 2011-08-10 11:08:42 +0200 (CEST)

View full thread Perl Upload Script