Sandra Hibma <[EMAIL PROTECTED]> wrote:
> In MMBase I upload, for example, a PDF file, using the attachments builder. The
> mimetype is recognised as PDF and the file is stored in the database. So far so
> good. Now, in my template I use the tag <mm:attachment /> (producing
> attachment.db?1053) to retrieve a link to my stored PDF-file. If I click this link
> it does not open Adobe Acrobat, but asks if I want to download or open the file (In
> Internet Explorer). It does not recognise my file as a PDF.
> What can I do to make sure that my attachment opens in the right programm(, using
> its mimetype).
> (I've tried this with different browsers, results are the same)
As far as I know, the mime-type (and content-disposition) should be honoured by the
browsers. But
possibly, IE mainly looks at filename to determin what it should do.
Perhaps it will help to generate url's with filename that will be recognized by IE.
IIRC this will happen automaticly by the <mm:attachment /> tag if you map the
attachmentservlet to
something which can contain a file-name in web.xml.
Consicely, please check if it goes better if you change the concerning lines in
web.xml to this:
<servlet-mapping>
<servlet-name>attachments</servlet-name>
<url-pattern>/attachments/*</url-pattern>
</servlet-mapping>
It will then (hopefully) generate links like
/attachments/sometitleofattachment.pdf?1053
which will work accactly the same, though will help some browsers.
MIchiel
--
Michiel Meeuwissen
Mediapark C101 Hilversum
+31 (0)35 6772979
nl_NL, eo, en_US
mihxil'
[]()