FileUpload - item.getName() return value

Posted on 2006-05-30
Medium Priority
Last Modified: 2012-06-27

I have this problem when gathering information for a file to be uploaded using FileUpload.

let's say the filename is: Abc.rtf

when I upload it using the commons FileUpload, the file was renamed to abc.rtf
I also noticed that in my code upon getting the filename by using item.getName(), it returns a the fullpath of the file which is all in lowercase.

Question is, How can I get the filename without the uppercase letters being converted to lowercase letters?
Question by:icemico
LVL 92

Expert Comment

ID: 16788518
not sure you can. may be case insensitive

Accepted Solution

colr__ earned 150 total points
ID: 16788532
Use Javascript.

Whent the use clicks the 'browse' button on their browser to select the file upload, have javascript set a dynamic hidden field whose value os the file name. Then capture this hidden field at your server end to correctly determine the original file name.


Author Comment

ID: 16788959
thanks a lot!

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question