File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to write a file in a web enviroment ?

 
Marcio Di Pietro
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends, i'm using the example of upload that comes with the struts.
The example works fine, but when a choose a path to save the uploaded file, i must to pass a concrete path, like "c:/.../img/teste.jpg"
But the application is in the web, hosted in a server in any place.
How can i define the target path to the file be saved in a web enviroment ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the ServletContext.getRealPath() method if you want to save the file within the app context, or specify the base path as an init parameter or property.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic