本人用jsasmart组件上传图片并入库,form表单与要上传的文件混合上传,第一次上传没有问题,可是在接着传第二条时会出现内存溢出,查找了一下原因发现是:
第二次上传时,jspsmart.getRequest.getParameter()获取的form表单值还是第一条记录的值
Example:
  第一条记录:
  学号:1  照片:x.jpeg
  第二条记录:
  学号:2  照片:y.jpeg
点击上传第一条成功入库,继续点击上传第二条,报错:indexoutofbounds;
debug发现,jspsmart.getRequest.getParameter()得到的还是学号为一的信息。请高手解决!谢谢

解决方案 »

  1.   

    前台:
    <form action="sjadd" method="POST" enctype="multipart/form-data" name="myform">  <input type='hidden' name='xh' value=<%=xh%>>
      
      <td>照片<input type='file' name='zp'></td></form>
    后台:
    ......
    SmartUpload su=new SmartUpload();
    ......
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    ......
    su.upload();xh=su.getRequest().getParameter("xh").trim();就是这里永远获得的是第一次得到的值