Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26386

    I would like to force a file download rather than displaying the pdf file using the jsp tag lib. Is this possible? I know it is accomplished using the following http header:

    Content-disposition: attachment; filename=name.ext

    where name.ext is the name of the pdf file. I see how to write out the pdf file to disk using pd4ml:savefile, but don’t see how to set the response header.

    Is there an easy way to do this that I am missing?

    #28013

    If you use PD4ML taglib, you can force “Content-disposition: attachment” header output by inline=”false” attribute of tag. With name attribute you may define a default name.

    #28014

    Thanks – this works fine except that I can’t control the file name. “name” is not attribute for pd4ml:transform. Do I need to use pd4ml:savefile? I am also having trouble using dynamic content within attributes.

    #28015

    My mistake. The correct attribute name is fileName

    See: http://www.pd4ml.com/taglib/pd4ml/transform.html

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘General questions / FAQ’ is closed to new topics and replies.