*alexandre* has asked for the wisdom of the Perl Monks concerning the following question:
I didn't facing any error the file test_upload_and_thumb.jpg is uploaded but no thumb is created and no error in the server log. Thanks#!/usr/bin/perl use CGI; use Image::Thumbnail; my $imgdir= "/var/www/upload"; my $query = new CGI; uploadImage('test_upload_and_thumb.jpg'); sub uploadImage { my $name = shift || ''; my $file = $query->upload('image'); open(LOCAL, ">$imgdir/$name") or print 'error'; my $file_handle = $query->upload('image'); + binmode LOCAL; while(<$file_handle>) { print LOCAL; } close($file_handle); close(LOCAL); createImageMagickThumb("$name"); } sub createImageMagickThumb { my $filename = shift || ''; my $t = new Image::Thumbnail( size => 55, create => 1, input => '$imgdir/$filename', outputpath => '$imgdir/thumb.$filename', ); print "Content-Type: text/html\n\n"; print "outputpath => '$imgdir/thumb.$filename'"; }
|
---|