Why am I always getting corrupted image file when uploading to FTP server? .gif
image doesn't get corrupted, only .jpeg
/jpg
and .png
get corrupted.
sub png{
my $ftp=Net::FTP->new($fhost)or die &ftpErr;
$ftp->login($hostname, $hostpass);
my $img=$ftp->put("$file");
$ftp->get($img);
$ftp->quit;
our $image="$img";
our $shot=$window->Photo(-format=>'png',-file=>"$image");
$window->Label(-relief=>'ridge',-image=>$shot,-width=>50,-height=>50)->pack(-anchor=>'n');
}
sub jpeg{
my $ftp=Net::FTP->new($fhost)or die &ftpErr;
$ftp->login($hostname, $hostpass);
my $img=$ftp->put("$file");
$ftp->get($img);
$ftp->quit;
our $image="$img";
our $shot=$window->Photo(-format=>'jpeg',-file=>"$image");
$window->Label(-relief=>'ridge',-image=>$shot,-width=>50,-height=>50)->pack(-anchor=>'n');
}