问题
I am trying to upload list of files to the server using spring MVC. But i am able to store on to the c drive,but i don't know how to upload onto server.Please help me.
回答1:
create a folder inside the Tomcat 9 (server) directory as follows
.../Apache Software Foundation/Tomcat 9/FileUpload
then, you can access the above directory (FileUpload) in java
File fileUpload = new File(System.getProperty("catalina.base"), "FileUpload");
but, if you use the eclipse ide, in the development time you cannot access the above directory and you should be created a folder as same name (FileUpload) in the following directory for eclipse
.../workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/FileUpload
you can use above directory for development and testing purpose
来源:https://stackoverflow.com/questions/60335303/uploading-files-on-to-server-using-spring-mvc