You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by st...@sixty4bit.com on 2003/05/16 19:03:11 UTC

File Upload

Is there any way to get the path (from the client side) of a file that has been 
uploaded.  The end goal is when validation fails, the user doesn't have to hit 
the browse button and choose the file again before resubmitting the form.

Thanks, 


Carl


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


RE: File Upload

Posted by Carl Fyffe <st...@sixty4bit.com>.
Martin, 

Thank you for clearing that up.

Carl

-----Original Message-----
From: news [mailto:news@main.gmane.org] On Behalf Of Martin Cooper
Sent: Friday, May 16, 2003 2:59 PM
To: struts-user@jakarta.apache.org
Subject: Re: File Upload


Basically, no. See:

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg70392.html

--
Martin Cooper


<st...@sixty4bit.com> wrote in message
news:1053104591.3ec519cf354dc@mail.sixty4bit.com...
>
> Is there any way to get the path (from the client side) of a file that

> has
been
> uploaded.  The end goal is when validation fails, the user doesn't 
> have to
hit
> the browse button and choose the file again before resubmitting the 
> form.
>
> Thanks,
>
>
> Carl




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


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


Re: File Upload

Posted by Martin Cooper <ma...@apache.org>.
Basically, no. See:

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg70392.html

--
Martin Cooper


<st...@sixty4bit.com> wrote in message
news:1053104591.3ec519cf354dc@mail.sixty4bit.com...
>
> Is there any way to get the path (from the client side) of a file that has
been
> uploaded.  The end goal is when validation fails, the user doesn't have to
hit
> the browse button and choose the file again before resubmitting the form.
>
> Thanks,
>
>
> Carl




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


Re: File Upload

Posted by Erik Price <ep...@ptc.com>.

struts@sixty4bit.com wrote:
> Is there any way to get the path (from the client side) of a file that has been 
> uploaded.  The end goal is when validation fails, the user doesn't have to hit 
> the browse button and choose the file again before resubmitting the form.

Can you store the path of the file into a hidden form field using 
JavaScript/DOM and send that to the server so that the server can 
repopulate the value of the field?



Erik


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


Re: File Upload

Posted by Mark Lowe <ma...@talk21.com>.
check the fileUpload example .

You'll need it to be a property of your form bean. or if the form is 
scoped to the request you could use the getPathInfo method in the 
HttpServletRequest api from the file object.

off the top of my head..

ActionForm theForm = (ActionForm) form;

File myFile = form.getFile();
String path = myFile.getPathInfo()

cheers mark


Venerdì, 16 mag 2003, alle 18:20 Europe/London, struts@sixty4bit.com ha 
scritto:

> Mark, right, but how do I GET the path?
>
> Carl
>
> Quoting Mark Lowe <ma...@talk21.com>:
>
>> yes .. if you've a form handler action then store the path in the
>> session.
>>
>> cheers mark
>>
>> Venerdì, 16 mag 2003, alle 18:03 Europe/London, struts@sixty4bit.com 
>> ha
>> scritto:
>>
>>>
>>> Is there any way to get the path (from the client side) of a file 
>>> that
>>> has been
>>> uploaded.  The end goal is when validation fails, the user doesn't
>>> have to hit
>>> the browse button and choose the file again before resubmitting the
>>> form.
>>>
>>> Thanks,
>>>
>>>
>>> Carl
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Re: File Upload

Posted by st...@sixty4bit.com.
Mark, right, but how do I GET the path?

Carl

Quoting Mark Lowe <ma...@talk21.com>:

> yes .. if you've a form handler action then store the path in the 
> session.
> 
> cheers mark
> 
> Venerdì, 16 mag 2003, alle 18:03 Europe/London, struts@sixty4bit.com ha 
> scritto:
> 
> >
> > Is there any way to get the path (from the client side) of a file that 
> > has been
> > uploaded.  The end goal is when validation fails, the user doesn't 
> > have to hit
> > the browse button and choose the file again before resubmitting the 
> > form.
> >
> > Thanks,
> >
> >
> > Carl
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 




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


Re: File Upload

Posted by Mark Lowe <ma...@talk21.com>.
yes .. if you've a form handler action then store the path in the 
session.

cheers mark

Venerdì, 16 mag 2003, alle 18:03 Europe/London, struts@sixty4bit.com ha 
scritto:

>
> Is there any way to get the path (from the client side) of a file that 
> has been
> uploaded.  The end goal is when validation fails, the user doesn't 
> have to hit
> the browse button and choose the file again before resubmitting the 
> form.
>
> Thanks,
>
>
> Carl
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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