就是 不能保存:可能的原因,  1  路径不对。 这里注意 linux 和 windows的区别!
              2  没有权限。

解决方案 »

  1.   

    System.out.println("mySmartUpload.getFiles().getCount()"+mySmartUpload.getFiles().getCount());
    to see whether the server has get the files' stream from the client.
      

  2.   

    我用的是winxp,tomcat5,sqlserver,
    你帮我看看源码哪里有问题
    request.setCharacterEncoding("GB2312");
    //初始化
    mySmartUpload.initialize(pageContext);
    mySmartUpload.upload();         String num=(String)session.getValue("number");
    String school=(String)session.getValue("school");
    String oldpath=(String)session.getValue("oldpath");
    session.removeValue("oldpath");
    String saveadd="c:/paper/2003/"+school+"/"+num;com.jspsmart.upload.File myFile=mySmartUpload.getFiles().getFile(0);

    if (!myFile.isMissing()) {
    java.io.File oldFile=new java.io.File(oldpath);
    oldFile.delete();
    java.io.File fileDir;
    String path;
    //创建文件保存路径
    if((saveadd!=null)&&(saveadd.length()>0)){
         String[] pathArray=saveadd.split("/");
         boolean[] resultArray=new boolean[pathArray.length-1];
         if(pathArray.length>=2){
             path=pathArray[0]+"/"+pathArray[1];
             fileDir = new java.io.File(path);  
            if(!fileDir.exists())
               resultArray[0]=fileDir.mkdir();  
            for(int i=2;i<pathArray.length;i++){
               path=path+"/"+pathArray[i];
               fileDir=new java.io.File(path);
               if(!fileDir.exists())
                  resultArray[i-1]=fileDir.mkdir();  
            }
           }
         }
    myFile.saveAs(saveadd+"/"+myFile.getFileName());
    saveadd=saveadd+"/"+myFile.getFileName();
    }
    else
    {saveadd=oldpath;}