Henry Wong, ¶À³Ç¼e wrote:

> 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?

Try the version on my Tripod site.  If you want to try to
debug this one, see below and add some print statements.

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

BEGIN {
        use CGI::Carp qw(carpout fatalsToBrowser);
        &carpout (\*STDOUT);
        print "Content-Type: text/plain\n\n"; # or html
}

> 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";



-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)


_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to