commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Wall <d.w...@computer.org>
Subject Re: FileItem.getName() (v1.1) always lowercase?
Date Sat, 08 Apr 2006 00:20:51 GMT

>Yes, that is the case. It's a bug that has already been fixed. You can pick
>up a nightly build if you need the fix; that's pretty safe, since nothing
>else has changed since the 1.1 release.
>  
>
Thanks.  Works fine.

>I also noted that IE was uploading with the full path to the file, while
>  
>
>>Firefox just sent the file name.  The full path seems like an unexpected
>>amount of info leakage when sending a file.
>>    
>>
>
>
>That's not something that Commons FileUpload has any effect on. It's
>entirely up to the browser to decide what to send. I agree with you that
>it's more than I'd like to expose, but there's no way around it. Well, I
>guess there is - don't use IE. ;-)
>  
>
True, but I noted that O'Reilly's version just added this snippet to 
remove any trailing / or \:

                    // The filename may contain a full path.  Cut to 
just the filename.
                    int slash = Math.max(filename.lastIndexOf('/'), 
filename.lastIndexOf('\\'));
                    if (slash > -1) {
                        filename = filename.substring(slash + 1);  // 
past last slash
                    }

Thanks,
David

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