For some reason when I upload a file and save it on
/tmp/test.jpg, it save it as a zero byte file.  Does
anyone have a suggestion how I can debug this?


#!/usr/bin/perl
use strict;
use Image::Size;
use CGI qw/:standard/;

my $IS_MODPERL = $ENV{MOD_PERL};
*exit = $IS_MODPERL ? \&Apache::exit : sub {
CORE::exit };

my $cgi = new CGI;

my $file = $cgi->param('file');

my ($buffer, $byte);
{
no strict;
open (FH, ">/tmp/test.jpg");
my $buffer;
while (read $file, $buffer, 1024) {
   print FH $buffer;
};
};

my ($x,$y,$z) = imgsize('/tmp/test.jpg');
print $cgi->header;
print "$x , $y, $z";


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to