You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Arpan <ar...@gmail.com> on 2012/03/05 18:13:32 UTC

struts1 folder selection through browse button

Hi All,

I have a requirement, where I should have a text box and a browse
button.,The user can select a folder through "browse" button or can write
that folder path in the text box directly.

I have seen struts file upload mechanism. But here I only need to select a
folder or folder path and not a file.

And that folder path should be accessed in the action class.

I am using struts1. Can anybody give some ideas.

Thanks

Re: struts1 folder selection through browse button

Posted by Arpan <ar...@gmail.com>.
The user intended here, would be an admin and would like to select the
folder through "browse" button, so that he doesn't have to write down the
whole folder path in the text box.

The browse button will not have any more action.
Only the folder path, written on the text box, either by selecting through
"browse" button or directly written the whole path, will be sent to the
server.

On Mon, Mar 5, 2012 at 10:45 PM, Dave Newton <da...@gmail.com> wrote:

> What good would it do anyway? The server can't access a client directory
> anyway.
>
> In any case, browser file choosers choose files, not directories--that's a
> browser thing. Even if it could, different browsers send different
> information--some browsers send only the filename, some send the entire
> client path.
>
> Dave
>
> On Mon, Mar 5, 2012 at 12:13 PM, Arpan <ar...@gmail.com> wrote:
>
> > Hi All,
> >
> > I have a requirement, where I should have a text box and a browse
> > button.,The user can select a folder through "browse" button or can write
> > that folder path in the text box directly.
> >
> > I have seen struts file upload mechanism. But here I only need to select
> a
> > folder or folder path and not a file.
> >
> > And that folder path should be accessed in the action class.
> >
> > I am using struts1. Can anybody give some ideas.
> >
> > Thanks
> >
>

Re: struts1 folder selection through browse button

Posted by Dave Newton <da...@gmail.com>.
What good would it do anyway? The server can't access a client directory
anyway.

In any case, browser file choosers choose files, not directories--that's a
browser thing. Even if it could, different browsers send different
information--some browsers send only the filename, some send the entire
client path.

Dave

On Mon, Mar 5, 2012 at 12:13 PM, Arpan <ar...@gmail.com> wrote:

> Hi All,
>
> I have a requirement, where I should have a text box and a browse
> button.,The user can select a folder through "browse" button or can write
> that folder path in the text box directly.
>
> I have seen struts file upload mechanism. But here I only need to select a
> folder or folder path and not a file.
>
> And that folder path should be accessed in the action class.
>
> I am using struts1. Can anybody give some ideas.
>
> Thanks
>