应该是读文件的时候有问题:  while((bytesRead = streamIn.read(buffer, 0, 8192)) != -1){
            streamOut.write(buffer,0,buffer.length); //这样试下 
        }

解决方案 »

  1.   

    FileOutputStream 里传个File对象.
    就是先new 个出来,否则找不到你的那个filename.
      

  2.   

    是这样吗:
    File outfile = new File(dir + "/" + filename);
    OutputStream streamOut = new FileOutputStream(outfile);
    可是这样还是不行,不过这样:
    File outfile = new File("D:/abc.jpg");
    OutputStream streamOut = new FileOutputStream(outfile);
    这样就行了,好像new的时候只能指定名字,不能用字符串做参数?
      

  3.   

      解决了 原来是我看错地方了 它的路径是tomcat的 我一直在eclipse的目录里面找
      谢谢大家