Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can I upload a file in a war?

 
Alessandro Ilardo
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there, I'm using struts and JBoss to upload and save files on the disk.
The application comes our as ear -> war
If I'm not wrong the ear file is actually extract and deployed in a temporary folder, right?
So, what would be the best way to specify the location where to save the file, I mean inside my webapp.

Thanks in advance
[ May 27, 2007: Message edited by: Alessandro Ilardo ]
 
Pravin Jain
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a servlet or jsp you can use the getRealPath method convert
a path relative to your application root into the OS specific
path, this can help you to create a java.io.FileOutputStream
or java.io.FileWriter as per your requirement, which could be
the destination of your uploaded files within your webapp.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic