今天遇见一个奇葩的问题,项目在本地启动后上传图片一切正常。但是发布到服务器上后出现上传图片空白。文件服务器看图片大小是0KB,查了日志发现报Can’t create output stream!
看代码没有问题。因为在本地上传是正常的,看其他服务器的项目也是正常的。以为是文件夹的问题,但是不存在。因为这个路径的文件夹绝对存在的。
百度了一下,发现好多人遇到相同的坑。原因是tomcat下缺少temp文件夹。建一个文件夹就可以了。
项目上传图片报:Can't create output stream!
最新推荐文章于 2023-06-29 09:58:48 发布