You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Bryan Lewis <jb...@gmail.com> on 2010/03/30 16:26:38 UTC

getting full file path for an upload

I've been using the Upload component with good results.  Now I need to get
the full client-side path where the file came from.  I've tried
UploadedFile.getFilePath() but that gives me only the base filename, like
"foo.txt", not the absolute path.

The comments in UploadedFile say that getFilePath() returns "the complete
path, as reported by the client browser".  (Perhaps the base filename is all
that Firefox is reporting?  I've tried uploading from different
directories.)  I'm hoping there's some simple technique I'm overlooking.

Re: getting full file path for an upload

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 30 Mar 2010 11:26:38 -0300, Bryan Lewis <jb...@gmail.com>  
wrote:

> I've been using the Upload component with good results.  Now I need to  
> get the full client-side path where the file came from.  I've tried
> UploadedFile.getFilePath() but that gives me only the base filename, like
> "foo.txt", not the absolute path.

This would be a security problem, so no browser I know provides the full  
path.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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