各位好,我在jsp页与servlet中都使用了smartupload来下载文件,共同的问题是,下载完毕后,无论是使用javascript还是reponse.forword无法跳转,请高手帮助,解决即散分。
解决方案 »
- JSP 有.net的masterpage?
- 如何实现网页提供生成EXCEL下载
- java.lang.NoSuchMethodError: org.hibernate.hql.antlr.HqlBaseParser.recover异常
- 高分跪求调查问卷页面!!!(在线等,一经使用,马上结帖)
- 怎样批量删除,修改,添加在同一个jsp中提交到数据库里
- 转型的问题,高手帮忙看下!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- N个数据库间定期导数据的问题,大家我个思路巴谢谢!散100分
- 为什么我在JDEVELOP 10G中编译这句就会出现内部错误!
- 网上书店 java+sql 2000
- 文字显示问题!!!!十万火急!!!!
- 文件下载后的后遗症,请教高手,过路的好心人帮顶,多谢
- jsp页面怎样实现同时显示多国语言?
out.print("alert('你的信息!');\n");
out.print("window.document.location.href='index.jsp';\n");
out.print("</script>\n");
另:在IE5下正常,IE6下有问题
import javax.servlet.http.*;
import java.io.*;
import java.net.URLEncoder;
import com.jspsmart.upload.*;
import java.util.*;public class toolsdown extends HttpServlet {
private static final String CONTENT_TYPE = "text/html; charset=GBK";
//Initialize global variables
public void init() throws ServletException {
}
//Process the HTTP Get request
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
//Process the HTTP Post request
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
try
{
SmartUpload su = new SmartUpload();
su.initialize(getServletConfig(),request,response);
su.setContentDisposition(null);
String fileName = request.getParameter("fileName");
fileName = new String(fileName.getBytes("8859_1"), "gb2312");
String path = request.getParameter("downPath");
String filepath = path+fileName;
su.downloadFile(filepath);
}
catch ( Exception e )
{
}
}
//Clean up resources
public void destroy() {
}
}