I try a solution: untested code ahead.
use IO::File;
my $fh = IO::File->new_tmpfile;
$image->Write(file => $fh);
seek($fh, 0, 0);
$ftpSession->put($fh, $filename);
The temporary file will be erased as you close it. It's in someway as it never existed and it's just useful to pass a filehandle to the Net::FTP put method instead of a scalar (that the method doesn't accept).
$|=$_="1g2i1u1l2i4e2n0k",map{print"\7",chop;select$,,$,,$,,$_/7}m{..}g
| [reply] [Watch: Dir/Any] [d/l] |
Could you process the images on the CGI server, FTP all the images to the destination server, then delete them from the CGI server? Is the drive space THAT limited?
Granted, it's not as elegant as printing filehandles over Net::FTP, but it gets the job done.
| [reply] [Watch: Dir/Any] |
That is an option that I have considered, but the web application could have two people uploading 'potentially' the same filename to different destinations on the destination web server. So there is a potential of 'accidentially' overwriting someone else's image when it hits the CGI server.
I may have to do that (and develop some unique names to avoid the confilcts) but I still believe that this procedure has to be possible. With Perl all things are supposed to be possible... perhaps this is a limitation of Image Magick, but their web site (http://www.imagemagick.org/www/perl.html) doesn't reveal a solution.
- Mission
| [reply] [Watch: Dir/Any] |
First off thanks to joealba and giulienk for your guidance.
I believe that giulienk's logic is correct, and it seems to be right on. However it appears that Image Magick doesn't like to write to a temp file (at least in a W2K environment.) So after fighting with it for a long while, I finally gave up on the challenge for now. Perhaps I'll take this torch up at a later time. Therefore I did do what joealba suggested for a fix. I knew that would work, but it still seems like a hack. If someone ever does find a solution, please \msg me. Thanks.
- Mission | [reply] [Watch: Dir/Any] |