Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Uploaded File Location??

 
Pallavi ch
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all ,
I've uploaded a file to the server using struts - FormFile.
I'm able to get the file name and size in the server side.

but how do I know where it is saved on the disk??
I mean the file location?

OR

How do I save a uploaded file to a particular location??
 
alan wamser
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not saved to disk automatically, that's something that you'll have to do. Once you have the file you can write it to disk or even to a database. I've used the FormFile to upload a file from a form then used Hibernate to write the file to an Oracle database.

Look at the api, you'll see that FormFile has a method getInputStream...
 
Pallavi ch
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
It worked for me.
 
Hey! Wanna see my flashlight? It looks like this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!