我也想问这个问题,帮你顶一下阿

解决方案 »

  1.   

    有几个地方我需要确定一下:
    1.<form name="form2" method="post" action="uploadWarnSoundConf.do" enctype="multipart/form-data">在这里设置类型enctype;
    2.在bean中的获取并保存的方式:
    首先---
    private FormFile uploadFile;
    然后---
    String fname=uploadFile.getFileName();
    InputStream ins = uploadFile.getInputStream();
    OutputStream outs=new FileOutputStream(store_path+"/"+fname);
    int bytesRead=0;
    int size=uploadFile.getFileSize();
    byte[] buffer=new byte[size];
    while((bytesRead=ins.read(buffer,0,size))!=-1){
       outs.write(buffer,0,bytesRead);
    }
    我用的是简体操作系统,这样应用没有碰到过乱码问题。