Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
java spring mvc找不到上载的文件_Java_Spring Mvc_Tomcat - Fatal编程技术网

java spring mvc找不到上载的文件

java spring mvc找不到上载的文件,java,spring-mvc,tomcat,Java,Spring Mvc,Tomcat,我已经搜索了tomcat 8.0目录和它的子目录,但找不到上传的文件,该文件已成功上传 这是我的上传代码: File folder = new File("Uploads"); if(!folder.exists()){ folder.mkdirs(); } BufferedOutputStream buff =new BufferedOutputStream(new FileOutputStream(folder+File.separator+f.get

我已经搜索了tomcat 8.0目录和它的子目录,但找不到上传的文件,该文件已成功上传

这是我的上传代码:

File folder = new File("Uploads");
    if(!folder.exists()){
        folder.mkdirs();
    }
    BufferedOutputStream buff =new BufferedOutputStream(new FileOutputStream(folder+File.separator+f.getName()));
    buff.write(f.getFile().getBytes());
    buff.flush();
    buff.close();
    link = folder + File.separator + f.getName();
    }
    catch(IOException es){
        logger.info("error "+es.getMessage());
    }

正如Balaji所建议的,执行一个简单的文件夹.getAbsolutePath()显示它存储在sts/sts version/目录中。

尝试打印到console/log Folder.getAbsolutePath()并检查该目录!非常感谢,巴拉吉