- Installation -
Download4J is a JAVA/JSP/Servlets download component.
A [WAR] archive is available to make Download4J installation easier. It needs a servlet engine SERVLETS 2.2+ API compliant or a J2EE1.2+ compliant application server. ZIP and TAR.GZ archives are also available, uncompress and deploy them manually in your servlet engine if you're not familiar with WAR archive.
Any problem ? Read the [FAQ] first. Still a problem ? Post your question to our online JSP Forum.
is available as a WAR archive. It's a SERVLETS
2.2 standard archive for Web Applications.
What does it mean ?... It means that WAR installation
is as easy as a copy/paste, regardless to the servlet
To install Download4J WAR archive, copy download4j.war
under the webapps folder of your servlet engine before
running it. That's all :-)
Note that webapps folder depends on your servlet
engine. It could be webapps/, applications/ ... The
WAR file will be automatically uncompressed under
Note that application servers (JRun,
Websphere, Weblogic, ...) provide a graphical console
to install and deploy WAR files.
- Run Download4J for the first time :
Documentation : http://yourserver.com/download4j/documentation/index.html
Administration sample : http://yourserver.com/download4j/admin.jsp
Sample 1 : http://yourserver.com/download4j/foldersample.jsp
Sample 2 : http://yourserver.com/download4j/zipsample.jsp
Sample 2 : http://yourserver.com/download4j/databasesample.jsp
Note that at this step, Download4J is running but not configured yet.
- Once launched for the first time, stop the servlet engine to setup Download4J (JSP samples and/or configuration file) as you need. Browse the configuration section to learn more about Download4J parameters.
The Download4J WAR archive is downloadable at Download4J HomePage.
to install Download4J ZIP package ?
Depending on your servlet engine or Application
server, you have to create a new web application directory
and then uncompress Download4J ZIP or TAR.GZ package
into this directory.
there a JSP sample that work without any customization
Yes, foldersample.jsp is a ready-to-run sample. Matching
download source is downloadroot/ folder under WEB-INF/
folder. All is configured and included to make it
run without any configuration.
get "404 not found" error when trying to
download a file ?
If filename inludes "%" or ";"
or ".." characters then you will get a 404
error because of blacklist filtering. You could reset
the blacklist in JSP (Keys.BLACKLIST = null).
get an Exception when running databasesample.jsp ?
Check that :
- Your JDBC driver is available in the web application
- Your RDBMS is up.
- Download4J configuration file matches to the JDBC
driver and URL, database account and schema.
Download4J generate log files with download hits ?
Yes, enable it in your XML file (e.g. folder.xml)
in DOWNLOAD tag such as :
<DOWNLOAD LOGFOLDER="c:\" LOGLEVEL="2">
to reload configuration file without restarting the
servlet engine ?
You can't. You have to restart the servlet engine
each time you modify the configuration file. We plan
to add dynamic reload later.
to integrate UploadBean and Download4J with MySQL
See the following thread for
to implement my own DownloadServlet using Download4J
See API & Design section for a sample source of
to implement my own SQL requests into Download4J ?
add-on to learn how to override Download4J DownloadSource
database implementation. You will see how to pass
a custom parameter from JSP to DownloadSource too.
to download files with chinese filename ?
Checkout and install MultilanguageLink
add-on. If your files are in a database, depending
on encoding, you might
have to implement a DownloadSource to translate HTTP
request encoding to database encoding.
are lost when I restart my servlet engine ?
Yes, Download4J does not record download hits in file.
However you could implement this feature thanks to
the DownloadBean notification system.