Problem with file upload in forum

From: Maarten (rijt_at_dse.nl)
Date: 07/30/04

  • Next message: Jürgen Exner: "Re: UTF8 to Unicode conversion"
    Date: Fri, 30 Jul 2004 23:56:15 +0200
    
    

    I'm running a forum on a debian box and all of a sudden my uploads don't
    seem to be working anymore.

    The code for the upload is the folowing:

    sub _save_file{
        my ($self, $file_hdr, $file_name) = @_;
        my ($ret, $bytesread, $data);

        open (SAVE, ">$config->{'file_path'}/$file_name") or die "an error
    occured:
        while ($bytesread = read($file_hdr,$data,1024)) {
        print SAVE $data;
        }
        close SAVE;
    $ret = -s "$config->{'file_path'}/$file_name";
    return $ret;

    Is there something wrong with this code?
    Because I'm getting files with a filesize of 0 kb instead of the real
    filesize.


  • Next message: Jürgen Exner: "Re: UTF8 to Unicode conversion"

    Relevant Pages

    • Problem with file upload in forum
      ... I'm running a forum on a debian box and all of a sudden my uploads don't ... seem to be working anymore. ... Because I'm getting files with a filesize of 0 kb instead of the real ...
      (comp.lang.perl.misc)
    • Re: Max File Size exceeded
      ... You are probably referring to>2mb filesize. ... setting in php.ini for uploads are 2 MB. ... modify php.ini on the server to handle larger files. ... > error message, instead the warning outputed: ...
      (php.general)