使用SmartUpload組件。
如﹕
<%@ page contentType="text/html; charset=big5" language="java" import="java.sql.*" errorPage="" %><%@ page import="com.jspsmart.upload.*"%><jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" /><%
    String sDocPath = request.getParameter("path");
String sFilename = request.getParameter("filename");
String sSorucePath = null;
if(request.getParameter("action").equals("file")){
sSorucePath = "G:\\Files\\" + sDocPath +"\\";
}else{
sSorucePath = "G:\\Files\\" + sDocPath +"\\Attachments\\";
} // Initialization
mySmartUpload.initialize(pageContext); // Download file
//mySmartUpload.downloadFile("/upload/sample.zip"); // With a physical path
//out.println(sSorucePath + sFilename);
 mySmartUpload.downloadFile(sSorucePath + sFilename);
// With options
// mySmartUpload.downloadFile("/upload/sample.zip","application/x-zip-compressed","downloaded.zip")
%>