geektron has asked for the wisdom of the Perl Monks concerning the following question:
To be safe, use the upload() function (new in version 2.47). When called with the name of an upload field, upload() returns a filehandle, or undef if the parameter is not a valid filehandle.everything looks fine ... but what if you want to do something different with the tmpfile?$fh = $query->upload('uploaded_file');
while (<$fh>) {
print;
}
I'm trying to pass it into Image::Magick, like so:
my $fh = $self->cgi->upload( 'map' ); my $thumb = Image::Magick->new(); $thumb->Read( file => \*$fh ) or die "No read to Image::Magick ob +j: $! \n";
it always dies on the read.
if $fh ( according to the docs ) is a filehandle, and Image::Magick expects a glob ref to a filehandle, what am i missing?
i've tried adding the full path to the image. no love.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI::upload and Image::Magick
by halley (Prior) on Aug 18, 2003 at 15:43 UTC | |
|
Re: CGI::upload and Image::Magick
by bear0053 (Hermit) on Aug 18, 2003 at 15:47 UTC | |
|
Re: CGI::upload and Image::Magick
by tcf22 (Priest) on Aug 18, 2003 at 15:47 UTC | |
by geektron (Curate) on Aug 18, 2003 at 16:35 UTC | |
by geektron (Curate) on Aug 18, 2003 at 15:53 UTC |