tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karel Miarka" <kaj...@issa.cz>
Subject Re: [BUG] IUploadFile not very smart about filenames and paths
Date Mon, 05 Apr 2004 11:57:36 GMT
It is already in Bugzilla:
http://issues.apache.org/bugzilla/show_bug.cgi?id=27544

Karel

----- Original Message ----- 
From: "Hunter Kelly" <retnuh@eircom.net>
To: "Tapestry users" <tapestry-user@jakarta.apache.org>
Sent: Monday, April 05, 2004 1:38 PM
Subject: [BUG] IUploadFile not very smart about filenames and paths


> I'm working on an application that uses uploaded files, and found the
> following very irritating behaviour.
>
> The server runs on a Linux box, but when someone uploads a file using IE
on a
> Windows machine, I get the following:
>
> uploadedFile.getFileName: C: \work\NetDownload\Design\DDD_2003-04-15.pdf
> uploadedFile.getFilePath: C:\work\NetDownload\Design\DDD_2003-04-15.pdf
>
> This seems like a bug to me - the file name should be the actual name
> of the file, with all the path information stripped.
>
> Since this is web software, I think the software needs to handle path
names
> from multiple platforms, without pushing that work back onto the
developer.
>
> I've had to add the following to get this to work.  It's pretty
> straightforward, but it's something I believe that Tapestry should be
doing
> for me.
>
>         IUploadFile uploadedFile = getUploadedFile();
>         String[] fileNameParts =
uploadedFile.getFileName().split("\\\\|/");
>         String fileName = fileNameParts[fileNameParts.length-1];
>
>
> Hunter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>



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


Mime
View raw message