Download taglib ver. 1.5

    Custom JSP tag. Lets you download files from your server.

For example:

<%@ taglib uri="taglib.tld" prefix="do" %>

<do:download file="/data/"/>

or you may download files from any directory on your server (even from the outside of your web application). E.g.:

<do:download file="report.doc" dir="c:/reports"/>

Tags are:


Downloads file. Parameters are:

1) file file for downloading
2) dir Optional parameter. Describes directory for files
3) compress Optional parameter. Possible values are true or false. If this value is true tag will compress downloaded file for clients with gzip support. Default value is false.
4) inline Optional parameter. Possible values are true or false. Describes how to download file. If this value is true client's browser will open file in place, otherwise tag will send file as an attachment and client will get 'Save as ...' dialog. Default value is false.
5) contentType Optional parameter. Describes a content type for your downloads. Default value is application/octet-stream. You can set this to auto for getting content type according to the downloaded file extension.
5) disposition Optional parameter. Possible values are true or false. Enables/disables Content-Disposition header. Default value is true (enabled). You may disable it for the mobile downloading, since some phones refuse to accept content when using it.

for downloading:

Library: dloadtag.jar    Description: taglib.tld

© Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in Coldtags: