commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knezevic, Mihael" <m.kneze...@porta.de>
Subject RE: [FileUpload] IE vs Firefox
Date Mon, 23 Jan 2006 09:39:42 GMT
this was discussed several time on the list. perhaps it should be written down in a FAQ?

> -----Original Message-----
> From: mfncooper@gmail.com [mailto:mfncooper@gmail.com] On 
> Behalf Of Martin Cooper
> Sent: Saturday, January 21, 2006 2:38 AM
> To: Jakarta Commons Users List
> Subject: Re: [FileUpload] IE vs Firefox
> 
> First of all, please respect the conventions of this mailing list, and
> prefix your subject with the name of the relevant component in square
> brackets, as I have done with this reply. See:
> 
> http://jakarta.apache.org/site/mail2.html#Commons
> 
> On 1/20/06, Xav <xxpikeboo@wanadoo.fr> wrote:
> >
> > Good Morning,
> >
> > It looks like the fileupload classes parse (or maybe 
> should) the request
> > a little bit differently depending if IE or Firefox is used.
> > I use the following code:
> >
> > List /* FileItem */items = upload.parseRequest( request ) ;
> > Iterator iter = items.iterator() ;
> > *while* ( iter.hasNext() ) {
> >   FileItem item = (FileItem) iter.next() ;
> >   ...
> > }
> >
> > When the item object is a file the method item.getName() 
> returns just
> > the file's name (ex: fooBar.gif) whereas with IE it returns the full
> > path of where the file was on the client side (ex: 
> c:\foo\bar\fooBar.gif).
> 
> 
> FileUpload is returning to you what the browser sent to the 
> server. IE sends
> the full path; most other browsers send only the file name, 
> for security
> reasons.
> 
> That might be an IE bug but do you think that the fileupload component
> > should be changed so that the method getName() always 
> returns the same
> > information regardless of the browser used?
> 
> 
> FileUpload's job is simply to parse the data sent to the 
> server, not to
> interpret it in any way. You might want only the file name, 
> but someone else
> might want the full path. That's a decision that can only be 
> made for a
> specific application, so it's not something FileUpload should 
> be doing.
> 
> --
> Martin Cooper
> 
> 
> Thanks
> > Xavier
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: 
> commons-user-help@jakarta.apache.org
> >
> >
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message