当我尝试使用Java上传文件时出现此错误,系统找不到指定的文件(tmp)

时间:2020-08-15 18:47:33

标签: java inputstream fileinputstream

我正在现金C驱动器中生成一个temp文件,它仅生成一个文件,而第二个文件未生成,并且出现此错误:

系统找不到指定的文件(tmp)*

InputStream inputStrJw = null;
inputStrJw = this.videoLinkEntertainment.getInputstream();
File destFileJw = new File("D:\\Program Files\\Apache Software Foundation\\Tomcat 9.0\\webapps\\movies\\" + this.gener + "\\" + fileNameVideo);
FileUtils.copyInputStreamToFile(inputStrJw, destFileJw);
this.GeneratedPath = "D:\\Program Files\\Apache Software Foundation\\Tomcat 9.0\\webapps\\movies\\" + this.gener + "\\" + fileNameVideo;

inputStrJw.close();

InputStream inputStrJw2 = null;
inputStrJw2 = this.coverImageEntertainment.getInputstream();
File destFileJw2 = new File("D:\\Program Files\\Apache Software Foundation\\Tomcat 9.0\\webapps\\movies\\" + this.gener + "\\" + fileNameImage);
FileUtils.copyInputStreamToFile(inputStrJw2, destFileJw2);
this.GeneratedPathForImage = "D:\\Program Files\\Apache Software Foundation\\Tomcat 9.0\\webapps\\movies\\" + this.gener + "\\" + fileNameImage;

inputStrJw2.close();

1 个答案:

答案 0 :(得分:0)

尝试打印目录中的所有文件,以查看文件是否已列出

File file = new File(".");
for(String aFile : file.list()) System.out.println(aFile);