httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Mearns <mearn...@gmail.com>
Subject Re: [users@httpd] pdf report generation - content type text/html
Date Tue, 03 Nov 2009 20:43:53 GMT
On Tue, Nov 3, 2009 at 3:06 PM, b k <bk4web@gmail.com> wrote:
> Thanks!! Actually, it's a java based app on the WebSphere app server that
> sends the response to Apache web server which in turn sends the response to
> the browser. I tested the reports directly on the App server which are
> working fine. I suspect something is wrong in the apache config. I also
> checked mime.types file which includes pdf entry.
>
> On Tue, Nov 3, 2009 at 2:32 PM, Brian Mearns <mearns.b@gmail.com> wrote:
>>
>> On Tue, Nov 3, 2009 at 2:26 PM, Marcin 'Rambo' Roguski
>> <rambo@id.uw.edu.pl> wrote:
>> > On Tue, 3 Nov 2009 14:20:27 -0500
>> > b k <bk4web@gmail.com> wrote:
>> >
>> >> Hi all,
>> >> PDF reports are not being generated on any browser. [...]Any help would
>> >> be greatly
>> >> appreciated!!!!
>> >
>> > Send Content-Type: application/pdf or application/octet-stream from your
>> > PDF generator
>> > text/html is just plain wrong.
>> >
>> > --
>> > Maslow's Maxim:
>> >        If the only tool you have is a hammer, you treat everything like
>> >        a nail.
>> >
>>
>> Well what's generating the PDF's? If they're coming from a file, you
>> need to configure Apache to correctly detect the mime type (as with
>> mod_mime: http://httpd.apache.org/docs/2.2/mod/mod_mime.html). Or if
>> they're all accessed through a particular root URL (like
>> /reports/pdf/), you can use the <Location> tag and ForceType:
>> http://httpd.apache.org/docs/2.2/mod/core.html#forcetype.
>>
>> If it's being generated by a server side script, you can try the above
>> <Location> method, or better, just get your script to generate the
>> correct Content-Type header. If you're using PHP, the default mime
>> type if you don't say otherwise is usually text/html, as you found,
>> but you can use the header() function to send the CT header like:
>> header("Content-Type: application/pdf").
>>
>> -Brian
>>
>> --
>> Feel free to contact me using PGP Encryption:
>> Key Id: 0x3AA70848
>> Available from: http://keys.gnupg.net

It sounds like you're saying you get the correct content-type header
if you communicate directly with the app server, and that Apache is
blowing it away? That's quite odd, but you might still try the
<Location> tag or similar to match the URL's the reports are accessed
by, and then use ForceType. I'm not sure if Apache will replace an
existing Content-Type header in this case, but it's worth a try.

-Brian


-- 
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://keys.gnupg.net

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message