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

问题描述

我正在现金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();

解决方法

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

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

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...