Uploading files on to server using spring mvc

岁酱吖の 提交于 2021-02-11 14:12:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!