Re: file upload path gives full path

2012-12-06 Thread Thad
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().

Re: file upload path gives full path

2012-12-06 Thread Jim Douglas
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

file upload path gives full path

2012-12-03 Thread sreenivas
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,

Re: file upload path gives full path

2012-12-03 Thread Markus
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