Try Apache Commons IO (http://commons.apache.org/io/
), org.apache.commons.io.FilenameUtils
On Tuesday, December 4, 2012 12:30:17 AM UTC-5, sreenivas wrote:
Hi,
I am uploading a file to server. when from firefox , it is giving only the
file name, when i access through fileItem.getName().
You'll find more than you want to know about it if you google
fakepath.
http://blogs.msdn.com/b/ie/archive/2009/03/20/rtm-platform-changes.aspx
On Dec 3, 9:30 pm, sreenivas putta.sreeni...@gmail.com wrote:
Hi,
I am uploading a file to server. when from firefox , it is giving only the
file
Hi,
I am uploading a file to server. when from firefox , it is giving only the
file name, when i access through fileItem.getName(). But with chrome it is
coming something like this. c:/fakepath/fileName. How to avoid this
fakepath string to come to server and get only the file name?
Thanks,
Hi,
we simply clear the filename:
if (filename.contains(/)) {
filename = filename.substring(filename.lastIndexOf('/') + 1);
}
if (filename.contains(\\)) {
filename = filename.substring(filename.lastIndexOf('\\') + 1);
}
--
You received this message because you are subscribed to the