用jspsmartupload做上传下载,其它文件能上传能下载,jsp、js格式就只能上传不能下载,求高手解决? 20
这是我的下载代码:<%@pagecontentType="text/html;charset=gb2312"language="java"import="java.uti...
这是我的下载代码:<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*,com.jspsmart.upload.*" errorPage="" %>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.text.*"%>
<%@ include file="checkbbsuser.jsp"%>
<%@ include file="../inc/conn.jsp"%>
<%@ include file="../inc/ftbbstohtml.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String filename = request.getParameter("filename");
String filesavename=request.getParameter("filesavename");
SmartUpload su = new SmartUpload();
su.initialize(pageContext);
su.setContentDisposition(null);
su.downloadFile("C:/Program Files/Tomcat 7.0/webapps/tianlan/upload/"+ filesavename);
%>
可以哈,我试过MP3、wmv、flv格式,都没有问题。就js、jsp有问题,打包成.jar文件都不行,我怀疑是不是因为文件格式和网站文件格式一样,导致了内部错误。求高手给好的解决方法…… 展开
<%@ page import="java.sql.*"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.text.*"%>
<%@ include file="checkbbsuser.jsp"%>
<%@ include file="../inc/conn.jsp"%>
<%@ include file="../inc/ftbbstohtml.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String filename = request.getParameter("filename");
String filesavename=request.getParameter("filesavename");
SmartUpload su = new SmartUpload();
su.initialize(pageContext);
su.setContentDisposition(null);
su.downloadFile("C:/Program Files/Tomcat 7.0/webapps/tianlan/upload/"+ filesavename);
%>
可以哈,我试过MP3、wmv、flv格式,都没有问题。就js、jsp有问题,打包成.jar文件都不行,我怀疑是不是因为文件格式和网站文件格式一样,导致了内部错误。求高手给好的解决方法…… 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询