Home > Back-end >  Save the file spring boot configuration virtual path failure
Save the file spring boot configuration virtual path failure

Time:10-01

Has been achieved images saved to the local, but always is to configure the virtual path is not successful, through the localhost: 808 x/image/1. JPG access failure images, below is my configure virtual path tools, please give advice or comments!
WebAppConfig. Java


Application. Yml


Engineering is not an error, click on the front end to confirm after the upload, the controller class to save image to the local operation is completed, but the picture access failure, only a warning when accessed through http://localhost:8081/images/20200402093554_1.jpg images to error




Instruct ah woo for bosses

CodePudding user response:

Is not the same as the two paths.

Save the path of Java

CodePudding user response:

Registry. AddResourceHandler ("/image/* * ")
AddResourceLocations (" file: "+ ParamConfig. FileBasePath);


FileBasePath=D: \ \ System \ \ image \ \

This

Try to get rid of file://

  • Related