Re: File Corrupt when download with ModPerl scripts

Vincent Veyron <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On Wed, 04 Feb 2015 20:22:52 +0100
Michel Jansen <[email protected]> wrote:

> Hi There,
> 
> Somehow images get corrupted when i read 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 like before they are 
> uploaded. When i download them directly from the webserver directory 
> where they are stored they are ok.
> 

Hi,

I can't comment on your code, but instead of slurping the file in your script, you could try to issue a redirect to the browser, so that it gets the file directly from the web server, to see if that solves the problem; something like :

    my $location = '/path/to/file' ;

    $r->headers_out->set(Location => $location) ;

    return Apache2::Const::REDIRECT ;



-- 
					Salutations, Vincent Veyron

https://marica.fr/
Gestion des contentieux, des dossiers de sinistres assurance et des contrats pour le service juridique
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.