diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index bc41911..3f70a37 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -493,7 +493,7 @@ class DateField(Field):
                 curry(cls._get_next_or_previous_by_FIELD, field=self, is_next=False))
 
     def get_db_prep_lookup(self, lookup_type, value):
-        # For "__month", "__day", and "__week_day" lookups, convert the value 
+        # For "__month", "__day", and "__week_day" lookups, convert the value
         # to a string so the database backend always sees a consistent type.
         if lookup_type in ('month', 'day', 'week_day'):
             return [force_unicode(value)]
@@ -637,8 +637,11 @@ class EmailField(CharField):
         return super(EmailField, self).formfield(**defaults)
 
 class FilePathField(Field):
-    def __init__(self, verbose_name=None, name=None, path='', match=None, recursive=False, **kwargs):
+    def __init__(self, verbose_name=None, name=None, path='', match=None,
+        recursive=False, allow_files=True, allow_folders=False, **kwargs):
         self.path, self.match, self.recursive = path, match, recursive
+        self.allow_files, self.allow_folders =  allow_files, allow_folders
+        assert self.allow_files or self.allow_folders
         kwargs['max_length'] = kwargs.get('max_length', 100)
         Field.__init__(self, verbose_name, name, **kwargs)
 
@@ -648,6 +651,8 @@ class FilePathField(Field):
             'match': self.match,
             'recursive': self.recursive,
             'form_class': forms.FilePathField,
+            'allow_files': self.allow_files,
+            'allow_folders': self.allow_folders,
         }
         defaults.update(kwargs)
         return super(FilePathField, self).formfield(**defaults)
diff --git a/django/forms/fields.py b/django/forms/fields.py
index bd4f3d4..a84c327 100644
--- a/django/forms/fields.py
+++ b/django/forms/fields.py
@@ -256,8 +256,8 @@ class DecimalField(Field):
         digits = len(digittuple)
         if decimals > digits:
             # We have leading zeros up to or past the decimal point.  Count
-            # everything past the decimal point as a digit.  We do not count 
-            # 0 before the decimal point as a digit since that would mean 
+            # everything past the decimal point as a digit.  We do not count
+            # 0 before the decimal point as a digit since that would mean
             # we would not allow max_digits = decimal_places.
             digits = decimals
         whole_digits = digits - decimals
@@ -283,7 +283,7 @@ DEFAULT_DATE_INPUT_FORMATS = (
 )
 
 class DateField(Field):
-    widget = DateInput 
+    widget = DateInput
     default_error_messages = {
         'invalid': _(u'Enter a valid date.'),
     }
@@ -822,14 +822,16 @@ class MultiValueField(Field):
         raise NotImplementedError('Subclasses must implement this method.')
 
 class FilePathField(ChoiceField):
-    def __init__(self, path, match=None, recursive=False, required=True,
-                 widget=None, label=None, initial=None, help_text=None,
-                 *args, **kwargs):
+    def __init__(self, path, match=None, recursive=False, allow_files=True,
+        allow_folders=False, required=True, widget=Select, label=None,
+        initial=None, help_text=None, *args, **kwargs):
         self.path, self.match, self.recursive = path, match, recursive
+        self.allow_files, self.allow_folders = allow_files, allow_folders
+        assert self.allow_files or self.allow_folders
         super(FilePathField, self).__init__(choices=(), required=required,
             widget=widget, label=label, initial=initial, help_text=help_text,
             *args, **kwargs)
-            
+
         if self.required:
             self.choices = []
         else:
@@ -840,15 +842,23 @@ class FilePathField(ChoiceField):
 
         if recursive:
             for root, dirs, files in os.walk(self.path):
-                for f in files:
-                    if self.match is None or self.match_re.search(f):
-                        f = os.path.join(root, f)
-                        self.choices.append((f, f.replace(path, "", 1)))
+                if self.allow_files:
+                    for f in files:
+                        if self.match is None or self.match_re.search(f):
+                            f = os.path.join(root, f)
+                            self.choices.append((f, f.replace(path, "", 1)))
+                if self.allow_folders:
+                    for f in dirs:
+                        if self.match is None or self.match_re.search(f):
+                            f = os.path.join(root, f)
+                            self.choices.append((f, f.replace(path, "", 1)))
         else:
             try:
                 for f in os.listdir(self.path):
                     full_file = os.path.join(self.path, f)
-                    if os.path.isfile(full_file) and (self.match is None or self.match_re.search(f)):
+                    if (((self.allow_files and os.path.isfile(full_file)) or
+                        (self.allow_folders and os.path.isdir(full_file))) and
+                        (self.match is None or self.match_re.search(f))):
                         self.choices.append((full_file, f))
             except OSError:
                 pass
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt
index 63ac707..47bbb1f 100644
--- a/docs/ref/forms/fields.txt
+++ b/docs/ref/forms/fields.txt
@@ -328,7 +328,7 @@ Takes one extra required argument:
 
     An iterable (e.g., a list or tuple) of 2-tuples to use as choices for this
     field.
-    
+
 ``TypedChoiceField``
 ~~~~~~~~~~~~~~~~~~~~
 
@@ -437,7 +437,7 @@ If no ``input_formats`` argument is provided, the default input formats are::
       ``min_value``, ``max_digits``, ``max_decimal_places``,
       ``max_whole_digits``
 
-Takes four optional arguments: 
+Takes four optional arguments:
 
 .. attribute:: DecimalField.max_value
 .. attribute:: DecimalField.min_value
@@ -449,7 +449,7 @@ Takes four optional arguments:
     The maximum number of digits (those before the decimal point plus those
     after the decimal point, with leading zeros stripped) permitted in the
     value.
-    
+
 .. attribute:: DecimalField.decimal_places
 
     The maximum number of decimal places permitted.
@@ -522,18 +522,30 @@ extra arguments; only ``path`` is required:
     A regular expression pattern; only files with names matching this expression
     will be allowed as choices.
 
-``FloatField`` 
-~~~~~~~~~~~~~~ 
-
-    * Default widget: ``TextInput`` 
-    * Empty value: ``None`` 
-    * Normalizes to: A Python float. 
-    * Validates that the given value is an float. Leading and trailing 
-      whitespace is allowed, as in Python's ``float()`` function. 
-    * Error message keys: ``required``, ``invalid``, ``max_value``, 
-      ``min_value`` 
-	 
-Takes two optional arguments for validation, ``max_value`` and ``min_value``. 
+.. attribute:: FilePathField.allow_files
+
+    Optional.  Either ``True`` or ``False``.  Default is ``True``.  Specifies
+    whether files in the specified location should be included.  Either this or
+    :attr:`~FilePathField.allow_folders` must be ``True.
+
+.. attribute:: FilePathField.allow_folders
+
+    Optional.  Either ``True`` or ``False``.  Default is ``False``.  Specifies
+    whether folders in the specified location should be included.  Either this
+    or :attr:`~FilePathField.allow_files` must be ``True.
+
+``FloatField``
+~~~~~~~~~~~~~~
+
+    * Default widget: ``TextInput``
+    * Empty value: ``None``
+    * Normalizes to: A Python float.
+    * Validates that the given value is an float. Leading and trailing
+      whitespace is allowed, as in Python's ``float()`` function.
+    * Error message keys: ``required``, ``invalid``, ``max_value``,
+      ``min_value``
+
+Takes two optional arguments for validation, ``max_value`` and ``min_value``.
 These control the range of values permitted in the field.
 
 ``ImageField``
@@ -779,10 +791,10 @@ example::
    (which is ``"---------"`` by default) with the ``empty_label`` attribute, or
    you can disable the empty label entirely by setting ``empty_label`` to
    ``None``::
-   
+
         # A custom empty label
         field1 = forms.ModelChoiceField(queryset=..., empty_label="(Nothing)")
-        
+
         # No empty label
         field2 = forms.ModelChoiceField(queryset=..., empty_label=None)
 
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index 6630b7b..f0ff39b 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -571,6 +571,19 @@ directory on the filesystem. Has three special arguments, of which the first is
     Optional. Either ``True`` or ``False``. Default is ``False``. Specifies
     whether all subdirectories of :attr:`~FilePathField.path` should be included
 
+.. attribute:: FilePathField.allow_files
+
+    Optional.  Either ``True`` or ``False``.  Default is ``True``.  Specifies
+    whether files in the specified location should be included.  Either this or
+    :attr:`~FilePathField.allow_folders` must be ``True.
+
+.. attribute:: FilePathField.allow_folders
+
+    Optional.  Either ``True`` or ``False``.  Default is ``False``.  Specifies
+    whether folders in the specified location should be included.  Either this
+    or :attr:`~FilePathField.allow_files` must be ``True.
+
+
 Of course, these arguments can be used together.
 
 The one potential gotcha is that :attr:`~FilePathField.match` applies to the
diff --git a/tests/regressiontests/forms/fields.py b/tests/regressiontests/forms/fields.py
index 0dc49f2..4b218bf 100644
--- a/tests/regressiontests/forms/fields.py
+++ b/tests/regressiontests/forms/fields.py
@@ -1104,7 +1104,7 @@ ValidationError: [u'Select a valid choice. 6 is not one of the available choices
 
 # TypedChoiceField ############################################################
 
-# TypedChoiceField is just like ChoiceField, except that coerced types will 
+# TypedChoiceField is just like ChoiceField, except that coerced types will
 # be returned:
 >>> f = TypedChoiceField(choices=[(1, "+1"), (-1, "-1")], coerce=int)
 >>> f.clean('1')
@@ -1122,7 +1122,7 @@ ValidationError: [u'Select a valid choice. 2 is not one of the available choices
 
 # This can also cause weirdness: be careful (bool(-1) == True, remember)
 >>> f.coerce = bool
->>> f.clean('-1') 
+>>> f.clean('-1')
 True
 
 # Even more weirdness: if you have a valid choice but your coercion function
@@ -1344,6 +1344,14 @@ u'.../django/forms/fields.py'
 >>> fix_os_paths(f.choices)
 [('.../django/forms/__init__.py', '__init__.py'), ('.../django/forms/extras/__init__.py', 'extras/__init__.py'), ('.../django/forms/extras/widgets.py', 'extras/widgets.py'), ('.../django/forms/fields.py', 'fields.py'), ('.../django/forms/forms.py', 'forms.py'), ('.../django/forms/models.py', 'models.py'), ('.../django/forms/util.py', 'util.py'), ('.../django/forms/widgets.py', 'widgets.py')]
 
+>>> f = forms.FilePathField(path=path, allow_folders=True, allow_files=False)
+>>> fix_os_paths(f.choices)
+[('.../django/forms/extras', 'extras')]
+>>> f = forms.FilePathField(path=path, allow_folders=True, allow_files=True)
+>>> f.choices.sort()
+>>> fix_os_paths(f.choices)
+[('.../django/forms/__init__.py', '__init__.py'), ('.../django/forms/__init__.pyc', '__init__.pyc'), ('.../django/forms/extras', 'extras'), ('.../django/forms/fields.py', 'fields.py'), ('.../django/forms/fields.pyc', 'fields.pyc'), ('.../django/forms/forms.py', 'forms.py'), ('.../django/forms/forms.pyc', 'forms.pyc'), ('.../django/forms/formsets.pyc', 'formsets.pyc'), ('.../django/forms/models.py', 'models.py'), ('.../django/forms/models.pyc', 'models.pyc'), ('.../django/forms/util.py', 'util.py'), ('.../django/forms/util.pyc', 'util.pyc'), ('.../django/forms/widgets.py', 'widgets.py'), ('.../django/forms/widgets.pyc', 'widgets.pyc')]
+
 # SplitDateTimeField ##########################################################
 
 >>> f = SplitDateTimeField()
