Re: file download with mod_perl

2000-10-12 Thread Axel Gerstmair

Hi Pritesh,

> Sorry for replying you late and many thanks for the solution. It has
> really made my scripts working(or should I say running) well in
> mod_perl.

> But is this pure implementation of mod_perl, when I put
> PerlSendHeader On in ?

I think this is the only way to go if you are porting or writing a CGI
script that creates its own HTTP header.
On the other hand if you are writing code directly for mod_perl you
should use the interface of the request object, i.e. $r->send_http_header.
I'm not quite sure, however, since I have not yet written a mod_perl
handler. I'm currently using mod_perl only to speed up my CGI scripts.
This way they stay independent of Apache and mod_perl.

-- Axel.





Re: file download with mod_perl

2000-10-12 Thread Pritesh Thakor

Hi Axel,

Sorry for replying you late and many thanks for the solution. It has really made my 
scripts working(or should I say running) well in mod_perl.

But is this pure implementation of mod_perl, when I put PerlSendHeader On in 
?

Waiting for your reply,

Pritesh.


On Friday, August 18, 2000 at 02:15:57 PM, Axel Gerstmair wrote:

> Hi Pritesh,
> 
> > However, the same code is not working under mod_perl. The file
> > content is the same as original file, but filename is populated as
> > download.cgi instead of actual file name. I think mod_perl is
> > putting its own headers, while sending the data.
> 
> Are you using the PerlSendHeader On directive in your httpd.conf file?
> If not put this into your  section (or whatever) and it
> should cure your problem, e.g.
> 
> 
>SetHandler perl-script
>PerlHandlerApache::Registry
>PerlSendHeader On
>Options+ExecCgi
> 
> 
> See also the online mod_perl guide
> http://perl.apache.org/guide/porting.html#Generating_correct_HTTP_Headers
> 
> I hope this helps,
> Axel
> 
> 
> 

pritesht
e-mail: [EMAIL PROTECTED]






Feed  Your Greed !!!
Get your 10MB Free space only at http://www.forindia.com NOW!







Re: file download with mod_perl

2000-08-18 Thread Axel Gerstmair

Hi Pritesh,

> However, the same code is not working under mod_perl. The file
> content is the same as original file, but filename is populated as
> download.cgi instead of actual file name. I think mod_perl is
> putting its own headers, while sending the data.

Are you using the PerlSendHeader On directive in your httpd.conf file?
If not put this into your  section (or whatever) and it
should cure your problem, e.g.


   SetHandler perl-script
   PerlHandlerApache::Registry
   PerlSendHeader On
   Options+ExecCgi


See also the online mod_perl guide
http://perl.apache.org/guide/porting.html#Generating_correct_HTTP_Headers

I hope this helps,
Axel





file download with mod_perl

2000-08-17 Thread pritesht

I am using following script in perl to download a file from the server to the local 
machine. The great thing about this code is, it populates a file save as dialog. The 
dialog is populated becuase of "Content-type:application/unknown\n 
Content-disposition:attachment;filename=$filetobedownloaded\n\n".
 
 
my ($in) = new CGI;
my ($filetobedownloaded)  = $in->param('filetobedownloaded');
my ($working_dir) = $in->param('wd');
 
print "Content-type:application/unknown\n 
Content-disposition:attachment;filename=$filetobedownloaded\n\n"
my $directory = "$config{'root_dir'}/$working_dir";
 
open (OUTFILE, "$directory/$filetobedownloaded");
binmode OUTFILE;
binmode STDOUT;
 
while () { 
 $in->print($_); 
} 
close (OUTFILE); 

 
However, the same code is not working under mod_perl. The file content is the same as 
original file, but filename is populated as download.cgi instead of actual file name. 
I think mod_perl is putting its own headers, while sending the data.
 
Any help will be greatly appreciated.

Thanks,
Pritesh.
pritesht
e-mail: [EMAIL PROTECTED]






Feed  Your Greed !!!
Get your 10MB Free space only at http://www.forindia.com NOW!