commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Priest <>
Subject RE: fileupload name issue
Date Mon, 25 Aug 2003 15:03:00 GMT
Try fi.getFieldName().

-----Original Message-----
From: Harshad Oak []
Sent: Monday, August 25, 2003 7:03 AM
Subject: fileupload name issue 


I am trying to use the FileUpload 1.0 component to upload three files from
an HTML page. I am submitting an HTML form to a JSP page.

The HTML is as follows:
    <FORM name="filesForm" action="ProcessFileUpload.jsp"
    method="post" enctype="multipart/form-data">
        File 1:<input type="file" name="file1"/><br/>
        File 2:<input type="file" name="file2"/><br/>
        File 3:<input type="file" name="file3"/><br/>
        <input type="submit" name="Submit" value="Upload Files"/>

In the JSP I have a statement (fi is a reference to

    System.out.println("NAME: "+fi.getName()); 

Strangely enough, if I submit the form using Opera browser version 7.11, the
output of the System.out in the JSP is just the <fileName>. However on
trying to submit it using Internet Explorer 5.5, the output is the entire
path eg: D:/<directoryname>/<filename>

Is this a known issue and what is the solution for it? I just need the name
and not the entire path to the file. I found a possible workaround in an article. However if this bug has been fixed in the latest CVS
copy, I could pick that up.


View raw message