perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Obtaining the Apache Content-type for a file
Date Fri, 13 Jan 2012 15:06:49 GMT
Hello.

re: mod_perl 2.x, httpd 2.x

I have a PerlResponseHandler which processes some kind of "logical document-id" provided 
in a request, locates the corresponding "real document" on the filesystem, and returns it

to the client via sendfile().
At the moment, this handler uses its own custom logic to determine the MIME type of the 
document and return it to the client as a Content-type HTTP header.

My question is : instead of this custom logic, does there exist a way, via mod_perl, to 
obtain this target file's MIME-type from Apache, using Apache's own logic (mod_mime, 
AddType etc..) for that ?

I have searched the online documentation, like 
(http://perl.apache.org/docs/2.0/api/APR/Finfo.html#C_filetype_),
but I am not quite sure that what I found so far is what I am looking for.

Thanks
AW

Mime
View raw message