# Directory form Select

**URL:** <https://www.ruby-forum.com/t/directory-form-select/112667>\
**Category:** Rails\
**Created:** [August 21, 2007, 11:35pm UTC](https://www.ruby-forum.com/t/directory-form-select/112667 "2007-08-21T23:35:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [August 21, 2007, 11:35pm UTC](https://www.ruby-forum.com/t/directory-form-select/112667/1 "2007-08-21T23:35:12Z")

</div>

Hi,

Is there a way to allow a user to select a directory. I know how to use  
the file\_field\_tag to allow users to select a file but i would like the  
ability to allow a user to select a directory and then use the path for  
various stuff. file\_field\_tag only allows for the selection of files.  
Ive searched around and cant find any examples of this.

JB

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [August 22, 2007, 10:21am UTC](https://www.ruby-forum.com/t/directory-form-select/112667/2 "2007-08-22T10:21:12Z")

</div>

John B. wrote:

> Hi,
> 
> Is there a way to allow a user to select a directory. I know how to use  
> the file\_field\_tag to allow users to select a file but i would like the  
> ability to allow a user to select a directory and then use the path for  
> various stuff. file\_field\_tag only allows for the selection of files.  
> Ive searched around and cant find any examples of this.
> 
> JB

It looks like a directory cannot be selected from a browser. I cant  
seem to get the file path from file\_field\_tag to use that as a way of  
getting the directory. What is the best way of getting a files path(i.e  
the directory its in)???

thepath = params[:xml\_file].path #this returns nothing??

John B
