in reply to Re: file upload
in thread file upload

Try the following:

my $file; open($file,"<test.txt") or die "urg: $!"; while ($bytes = read($file,$buffer,1024)) { $bytesread+=$bytes; print OUTFILE $buffer; } close(OUTFILE); close($file);

Also, $filename is probably being set by calling $filename = CGI::param('upload_file_field'); which returns a variable that acts as both a string and a filehandle. As for why it doesn't work for IE, we would need to know the version of IE and platform (if it's Mac and IE4.x, there's a known issue with uploading files...but I don't recall much beyond that) before we begin beating ourselves in the head over this. Since it works with other browsers, the problem seems to be with the version of IE.

antirice    
The first rule of Perl club is - use Perl
The
ith rule of Perl club is - follow rule i - 1 for i > 1

Replies are listed 'Best First'.
Re: Re: Re: file upload
by Dave's not here (Initiate) on Jul 11, 2003 at 16:06 UTC

    I am using CGI as you assumed. Sorry, I should have been more clear on that. The script does work on the Mac, althought I haven't tested it with IE4. It has successfully worked with MacOSX (Camino, IE, iCab, Safari), it also works fine on Linux (mozilla) and in Windows (Netscape). However, it is not working in Windows IE (XP/6.0) -- I'm trying to test on other Win/IE combos. So, it appears to be an IE issue.

    It does print the filename, but not the content (there's a 0K file), and the error log doesn't show anything.

    Also, this problem exists on two different servers:
    Apache/1.3.26 (Unix) PHP/4.2.3 mod_perl/1.27 on FreeBSD
    Perl 5.005_03

    Apache/1.3.27 (Unix) mod_ssl/2.8.11 OpenSSL/0.9.6b FrontPage/5.0.2.2510 PHP/4.3.0 mod_throttle/3.1.2 on Linux
    Perl 5.006