Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Struts and the fly likes can I upload a file in a war? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "can I upload a file in a war?" Watch "can I upload a file in a war?" New topic

can I upload a file in a war?

Alessandro Ilardo
Ranch Hand

Joined: Dec 23, 2005
Posts: 218
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 ]

trying to decode a woman mind....
Pravin Jain
Ranch Hand

Joined: May 20, 2007
Posts: 60
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
or as per your requirement, which could be
the destination of your uploaded files within your webapp.

The Zen of Java Programming.
I agree. Here's the link:
subject: can I upload a file in a war?