commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Stranathan" <wstranat...@hotmail.com>
Subject Re: [PATH]FileUpload fix for filename for msiexplorer
Date Mon, 30 Jun 2003 11:21:17 GMT
On any *nix system, try the following:

ehco 'hi'>with\\backslash
ls

You should see (in addition to any other files)
with\backslash

I'm not sure if it's a valid character in systems like iso9660 (I think it's 
very restrictive).  I'm also not sure about OLD Mac - new Mac's are just 
BSD, so the above ought to work there, too.

Furthermore, even if that WEREN'T the case, if FileUpload were being used in 
a "known" environment, where a developer KNEW the clients would only have 
IE, that "feature" might be useful - it might be important for a developer 
to know where on the filesystem the file came from.  I know the 
circumstances would be rare, but there is still the possibility that certain 
developers would be counting on that.

Regards,
Will


>From: <maciek@pb-network.com>
>Reply-To: maciek@pb-network.com
>To: <commons-dev@jakarta.apache.org>
>Subject: Re: [PATH]FileUpload fix for filename for msiexplorer
>Date: Sat, 28 Jun 2003 14:08:59 -0400 (EDT)
>
>Could you please give me an example of a valid filename with -\\ character
>specifying also the filesystem.
>Cheers,
>Maciej
> > Umm...unfortunately you can't really do that - \\ is a completely valid
> > character in filenames on other types of filesystems - so it's probably
> > still better to leave it up to the developer to determine what to do
> > with  the file.
> >
> > Regards,
> > Will Stranathan
> >
> >
> >>From: maciek <maciek@pb-network.com>
> >>Reply-To: "Jakarta Commons Developers List"
> >><commons-dev@jakarta.apache.org>
> >>To: commons-dev@jakarta.apache.org
> >>Subject: [PATH]FileUpload fix for filename for msiexplorer
> >>Date: 28 Jun 2003 13:46:31 -0400
> >>
> >>Method getName() in DefaultFileItem.java class when used with
> >>msiexplorer 5/6 returns a filename with the whole client's filesystem
> >> path which creates a problem when you want to save the file on a
> >>server's filesystem. I have chanaged the implementation of the
> >> getName() method to strip the path information from the filename.Below
> >> is my proposed implementation for getName() method:
> >>
> >>public String getName()
> >>     {
> >>
> >>          if(fileName.lastIndexOf("\\") != -1){
> >>
> >>               return fileName.substring(fileName.lastIndexOf("\\") +
> >> 1);
> >>
> >>          }else{
> >>
> >>               return fileName;
> >>          }
> >>     }
> >>
> >>I have attached the fileName_fix_forMSIE.txt patch file.
> >>
> >>I have rebuild the entire source code to create a new jar and tested it
> >> with Tomcat and Resin. It works now with MSIE. A simple call to
> >>item.getName() returns only filename where item is of type FileItem.
> >>
> >>I think that it would be a better idea to change the implementation of
> >> the method without breaking of the FileUpload component interface than
> >> letting web developers to take care of the problem inside a jsp file. I
> >> think users of the component should use the method transparently
> >> without worrying about the possible problem with MSIE with the
> >> guarantee that ONLY filename will be returned from getName() method.
> >>Regards,
> >>Maciej Brodala
> >>
> >>
> >><< fileName_fix_forMSIE.txt >>
> >>---------------------------------------------------------------------
> >> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For
> >> additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> > _________________________________________________________________
> > Tired of spam? Get advanced junk mail protection with MSN 8.
> > http://join.msn.com/?page=features/junkmail
> >
> >
> > --------------------------------------------------------------------- To
> > unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For
> > additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


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


Mime
View raw message