FileUpload - item.getName() return value

Posted on 2006-05-30
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

    not sure you can. may be case insensitive
    LVL 8

    Accepted Solution

    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

    thanks a lot!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Title # Comments Views Activity
    method argument as final 1 54
    advance java 4 35
    Understanding websocket example in spring 1 20
    firstChar challenge 13 55
    For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    761 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

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now