Jspdownload

姜泳
2023-12-01

download.jsp

<%@ page import="com.jspsmart.upload.*" %>
<%@ page contentType="text/html;charset=GB2312" %>

<html>
<head>
    <title> download.jsp</title>
</head>
<body>

<h2>文件下载范例 - jspSmart</h2>

<jsp:useBean id="mySmartUpload" scope="page"
                                                          class="com.jspsmart.upload.SmartUpload" />

<%
// SmartUpload之初始化
mySmartUpload.initialize(pageContext);

//必须如此声明,否则将会把文件显示于浏览器中
mySmartUpload.setContentDisposition("inline;");

//将 sample.zip下载,下载默认名称为downloaded.zip
mySmartUpload.downloadFile("C://upload//sample.zip",
                                                    "application/x-zip-compressed",
                                                    "downloaded.zip");
%>

</body>
</html>

 

 类似资料:

相关阅读

相关文章

相关问答