commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <mart...@apache.org>
Subject Re: [fileupload] getting filename from FileItem in browser independent way
Date Tue, 03 Oct 2006 15:50:11 GMT
On 10/3/06, Jacob Fenwick <jfenwick@mitre.org> wrote:
>
> I'd actually like to point out this incorrect line in the FAQ:
>
> " Internet Explorer provides the entire path to the uploaded file and
> not just the base file name. Since FileUpload provides exactly what was
> supplied by the client (browser), you may want to remove this path
> information in your application. You can do that using the following
> method from Commons IO (which you already have, since it is used by
> FileUpload)."
>
> As far as I can tell, you don't have access to this method if you're
> only using the org.apache.commons.fileupload library. You need to
> include the org.apache.commons.io library with your project.


Commons FileUpload 1.1 and later require Commons IO. If you're still using
FileUpload 1.0, you should upgrade, so that you get the bug fixes (and
enhancements).

--
Martin Cooper


Jacob Fenwick wrote:
> > Of course not, that would be far too intelligent!
> > Thanks Martin
> >
> > Martin Cooper wrote:
> >
> >> On 10/3/06, Jacob Fenwick <jfenwick@mitre.org> wrote:
> >>
> >>>
> >>> Hello,
> >>>
> >>> I've built a fileupload jsp and I want to get the original filename
> >>> of a
> >>> file. I put the file into a FileItem object and use the getName
> >>> function. When I'm in Firefox it works perfectly, as it gets just the
> >>> name and not the path. However when I'm in IE it uses the entire
> >>> path of
> >>> the file as the name. I want it to work the way it does in Firefox, I
> >>> want to get only the name and not the path. Has anyone encountered
> this
> >>> problem, and if you did, how did you solve it?
> >>
> >>
> >>
> >> You did, of course, check out the FAQ before posting, right? ;-)
> >>
> >>
> http://jakarta.apache.org/commons/fileupload/faq.html#whole-path-from-IE
> >>
> >> --
> >> Martin Cooper
> >>
> >>
> >> Thanks,
> >>
> >>> Jacob
> >>>
> >>> ---------------------------------------------------------------------
> >>> 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
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message