#!/usr/bin/perl use strict; use warnings; use Image::Magick; use CGI qw/:standard/; my $cgi = new CGI; my $file = $cgi->param('image'); if ( !$file ) { print header,start_multipart_form(), filefield('image',50,80), submit(-name=>'upload', -value=>'Upload'), end_form(); } else { print header; print "
FILE: $file\n"; my $image = Image::Magick->new; my $fh = upload('image'); $image->Read(file=>$fh); my $big_image = $image->ImageToBlob(); print "
DATA: $big_image\n"; }