There is no problem in testing and adding in the win system, but when I package and deploy the project to the Linux server, the browser reports error 500

 First of all, we need to see what is typed in the tomcat log. Because it is 500 on the server, it means that the server is abnormal. You need to look at the log.

The log error is ERROR com.mz.o2o.util.ImageUtil - java.io.FileNotFoundException: /Users/baidu/work/image/upload/images/item/shop/15/2022090522084613901.jpg (Permission denied)  

I checked the directory of the address of the picture I uploaded and it was correct, but I couldn’t find the picture in it

So the final solution is to directly chmod 777 -R directory address, the reason is that Linux has permission control 

Guess you like

Origin blog.csdn.net/romantic6666/article/details/129505554