Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Get a full path from a file

 
Hernan Tavella
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, how can i get the absolute path from an FileItem (org.apache.commons.fileupload Interface FileItem) i try several way but i can't get it.

This an example of what i need to do.



the c:\\pruebas\\ i should get it with some method or something.

thanks.
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand what "absolute path" you are asking about. From the code you posted, it looks like you wanted an absolute path on the server. But a FileItem object doesn't correspond to any location in the server's file system, it's just a set of bytes which was uploaded from the client system.

There's nothing stopping you from choosing a directory on the server to store the uploaded file in, and in fact that would probably be the best approach.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic