java - What should be the file upload path for CommonsMultipartFile if I want to save the files in the project path? -


i want upload file project relative path.

webapp/fileupload/ path want file upload.

so when give path

 commonsmultipartfile commonsfile = user.getimage();  string filename = commonsfile.getoriginalfilename();   file destfile = new file("http://localhost:8080/springdemo/fileupload/",filename); 

its giving me

java.io.filenotfoundexception: http:\localhost:8080\springdemo\fileupload\design.txt(the filename, directory name, or volume label syntax incorrect) 

i not understanding should right path.

i want save under project folder , not on other path using  http:\localhost:8080\springdemo\fileupload\as path.  when paste http://localhost:8080/springdemo/fileupload/abc.txt browser shows me file.(abc.txt) 

i not understanding should right path.

kindly suggest me right way this.

thanks in advance.

zingo

first off, files save within context lost if undeploy app, make sure that's want.

as question, http://localhost/etc/and/so/on url app, not file path.

the file path real path of underlying filesystem.

let's you're using tomcat, installed in /usr/share, file path within app might like: /usr/share/tomcat/webapps/yourapp/somewhere/you/want/files/stored/some-file.txt


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -