Jin_evan 2017-05-09 05:39 采纳率: 100%
浏览 1517
已采纳

SSH上传图片怎样保存路径到数据库?

//上传
public String add() throws Exception {
try{

if(product_type.getPtid()>0){
product_typeBiz.update(product_type);
}else{
product_typeBiz.add(product_type);
}
if(producy_typeImage!=null){
String vpath="/DASCOM/image/"+product_type.getPtname()+".jpg";
ServletContext application = ServletActionContext.getServletContext();
File destFile = new File("D:/"+vpath);
FileUtils.copyFile(producy_typeImage, destFile);

        }
        }catch(BizException e){
            this.jsonResult=new JsonResult(false, e.getMessage());
        }
        return SUCCESS;
}

JSP代码段

打印机类型
图片

  • 写回答

3条回答 默认 最新

  • Jin_evan 2017-05-09 06:31
    关注

    有知道的麻烦回复一下,谢谢!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?