perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John N. Brahy" <jbr...@ad2.com>
Subject Content Disposition header and file contents sequence...
Date Thu, 02 Mar 2006 18:46:09 GMT
This is the relevant part of my handler for a link that I want to force
a download for. I know it's content-disposition but for some reason I
can not get it to actually download the file. I get the download dialog
and I choose the location to save it but when I open the document it is
empty. I've tried changing the sequence of the items but it never works.


my $filename = "/usr/local/app/media/videos/downloads/preview.mov";
unless ($fileFH = Apache::File->new($filename)){
	$r->log_error("couldn't open $filename for reading: $!");
	return SERVER_ERROR;
}
$r->content_type('video/quicktime'); 
$r->headers_out->set('Content-Disposition' =>
"attachment;filename=$downloadFilename");
$r->send_fd($fileFH);
$r->send_http_header();
return OK;





::::: John Brahy
::::: CIO
::::: www.ad2.com

::::: johnb@ad2.com
::::: t: 310-356-7500
::::: f: 310-356-7520

::::: ad2, Inc.
::::: 1990 East Grand Ave, Suite 200
::::: El Segundo, CA 90245


Mime
View raw message