Grokbase Groups Perl qa February 2015
Hi There,

Somehow images and files get corrupted when i read them with a perl
script and then download them with a modperl script using File::Read or
File::Slurp. The images are not really broken but they get blurred and
dont look the same like before they are uploaded. When i download them
directly from the webserver directory where the files are stored are
stored they are ok.

I have also tried the script below but no success.


      print $args->{base}->{CGI}->header( -type => $mimetype, -attachment
=> $document );

      my $fname = $file;

      open my $in, q{<}, $fname or die qq{Could not open file <$fname>: $!};

      open my $out, q{>&STDOUT} or die qq{Cant dup STDOUT: $!};

      my ($more, $buf);
          $more = read $in, $buf, 4096;
          print $out $buf;
      } while $more;

      close $out or die $!;
      close $in or die $!;


Any hints that can help me out....?

Thanx in advance!


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupqa @
postedFeb 4, '15 at 9:32p
activeFeb 4, '15 at 9:32p

1 user in discussion

Michel Jansen: 1 post



site design / logo © 2019 Grokbase