Index: django/db/models/fields/__init__.py
===================================================================
--- django/db/models/fields/__init__.py	(revision 4664)
+++ django/db/models/fields/__init__.py	(working copy)
@@ -662,6 +662,11 @@
             else:
                 func(new_data[upload_field_name]["filename"], new_data[upload_field_name]["content"], save)
 
+    def formfield_save_file(self, field_name, new_data, new_object, save=True):
+        if new_data[field_name][0]:
+            func = getattr(new_object, 'save_%s_file' % self.name)
+            func(new_data[field_name][0]["filename"], new_data[field_name][0]["content"], save)
+
     def get_directory_name(self):
         return os.path.normpath(datetime.datetime.now().strftime(self.upload_to))
 
@@ -670,6 +675,11 @@
         f = os.path.join(self.get_directory_name(), get_valid_filename(os.path.basename(filename)))
         return os.path.normpath(f)
 
+    def formfield(self, **kwargs):
+        defaults = {'required': not self.blank, 'label': capfirst(self.verbose_name), 'widget': forms.FileInput}
+        defaults.update(kwargs)
+        return forms.FileField(**defaults)
+
 class FilePathField(Field):
     def __init__(self, verbose_name=None, name=None, path='', match=None, recursive=False, **kwargs):
         self.path, self.match, self.recursive = path, match, recursive
@@ -716,6 +726,11 @@
                 setattr(new_object, self.height_field, getattr(original_object, self.height_field))
             new_object.save()
 
+    def formfield(self, **kwargs):
+        defaults = {'required': not self.blank, 'label': capfirst(self.verbose_name), 'widget': forms.FileInput}
+        defaults.update(kwargs)
+        return forms.ImageField(**defaults)
+
 class IntegerField(Field):
     empty_strings_allowed = False
     def get_manipulator_field_objs(self):
Index: django/newforms/models.py
===================================================================
--- django/newforms/models.py	(revision 4664)
+++ django/newforms/models.py	(working copy)
@@ -18,6 +18,7 @@
 
     This method is created for any form_for_model Form.
     """
+    from django.db import models
     if self.errors:
         raise ValueError("The %s could not be created because the data didn't validate." % self._model._meta.object_name)
     return save_instance(self, self._model(), commit)
@@ -38,6 +39,9 @@
     for f in opts.fields:
         if not f.editable or isinstance(f, models.AutoField):
             continue
+        if isinstance(f,models.FileField):
+            f.formfield_save_file(f.name, clean_data, instance, save=False)
+            continue
         setattr(instance, f.name, clean_data[f.name])
     if commit:
         instance.save()
Index: django/newforms/fields.py
===================================================================
--- django/newforms/fields.py	(revision 4664)
+++ django/newforms/fields.py	(working copy)
@@ -10,7 +10,7 @@
 import time
 
 __all__ = (
-    'Field', 'CharField', 'IntegerField',
+    'Field', 'CharField', 'FileField', 'ImageField', 'IntegerField',
     'DEFAULT_DATE_INPUT_FORMATS', 'DateField',
     'DEFAULT_TIME_INPUT_FORMATS', 'TimeField',
     'DEFAULT_DATETIME_INPUT_FORMATS', 'DateTimeField',
@@ -107,6 +107,44 @@
         if self.max_length is not None and isinstance(widget, (TextInput, PasswordInput)):
             return {'maxlength': str(self.max_length)}
 
+class FileField(Field):
+
+    prev_error = False
+ 
+    def clean(self, value):
+        super(FileField, self).clean(value)
+
+        if value[0]:
+            try:
+                content = value[0]['content']
+            except TypeError:
+                self.prev_error = True
+                raise ValidationError(gettext("No file was submitted. Check the encoding type on the form."))
+
+            if not content:
+                self.prev_error = True
+                raise ValidationError(gettext(u'The submitted file is empty.'))
+
+        elif self.required:
+            if not value[1]:
+                self.prev_error = True
+                raise ValidationError(gettext(u'This field is required.'))
+
+        return value
+
+class ImageField(FileField):
+    
+    def clean(self, value):
+        super(ImageField, self).clean(value)
+        if value[0] and not self.prev_error:
+            from PIL import Image
+            from cStringIO import StringIO
+            try:
+                Image.open(StringIO(value[0]['content']))
+            except IOError: # Python Imaging Library doesn't recognize it as an image
+                raise ValidationError, gettext(u'Upload a valid image. The file you uploaded was either not an image or a corrupted image.')
+        return value
+
 class IntegerField(Field):
     def __init__(self, max_value=None, min_value=None, *args, **kwargs):
         self.max_value, self.min_value = max_value, min_value
Index: django/newforms/widgets.py
===================================================================
--- django/newforms/widgets.py	(revision 4664)
+++ django/newforms/widgets.py	(working copy)
@@ -115,6 +115,24 @@
 
 class FileInput(Input):
     input_type = 'file'
+    
+    def render(self,name,value,attrs=None,choices=()):
+        if value is None: value = ''
+        file_attrs = self.build_attrs(attrs, type='file', name=name+'_file')
+        final_attrs = self.build_attrs(attrs, type='hidden', name=name)
+        if value != '': final_attrs['value'] = smart_unicode(value) # only add the value attribute if a value is non-empty
+        
+        if value != '':
+            currently = u'Currently: %s<br/>Change: ' % smart_unicode(value)
+            current = u' <input%s />' % flatatt(final_attrs)
+        else:
+            currently = u''
+            current = u''
+         
+        return u'%s<input%s />%s' % (currently,flatatt(file_attrs),current)
+    
+    def value_from_datadict(self,data,name):
+        return [data.get(name+'_file',None),data.get(name,None)]
 
 class Textarea(Widget):
     def render(self, name, value, attrs=None):
Index: tests/modeltests/model_forms/models.py
===================================================================
--- tests/modeltests/model_forms/models.py	(revision 4664)
+++ tests/modeltests/model_forms/models.py	(working copy)
@@ -61,6 +61,20 @@
     def __str__(self):
         return self.phone
 
+class NotRequiredFile(models.Model):
+    description = models.CharField(maxlength=50)
+    file = models.FileField(upload_to='files', blank=True)
+
+    def __str__(self):
+        return self.description
+
+class RequiredFile(models.Model):
+    description = models.CharField(maxlength=50)
+    file = models.FileField(upload_to='files')
+
+    def __str__(self):
+        return self.description
+
 __test__ = {'API_TESTS': """
 >>> from django.newforms import form_for_model, form_for_instance, save_instance, BaseForm, Form, CharField
 >>> import datetime
@@ -377,6 +391,52 @@
 
 >>> f = ModelChoiceField(Category.objects.filter(pk=1), required=False)
 >>> print f.clean('')
+
+Test for filefield
+
+>>> form_data = {'description': 'FileField test', 'file_file': {'content': 'FileField test', 'filename': 'filetest.txt'} }
+>>> no_file_form_data = {'description': 'FileField test'}
+>>> just_path_form_data = {'description': 'FileField test', 'file': 'files/filetest.txt'}
+>>> bad_encoding_form_data = {'description': 'FileField test', 'file': 'files/filetest.txt', 'file_file': 'wrong encoding'}
+>>> TestRequiredFileForm = form_for_model(RequiredFile)
+>>> empty_required_fileform = TestRequiredFileForm(auto_id=False)
+>>> print empty_required_fileform.as_ul()
+<li>Description: <input type="text" name="description" maxlength="50" /></li>
+<li>File: <input type="file" name="file_file" /></li>
+
+Test with data
+>>> filled_required_fileform= TestRequiredFileForm(form_data, auto_id=False)
+>>> filled_required_fileform.is_valid()
+True
+
+>>> required_file_instance = filled_required_fileform.save()
+>>> print required_file_instance.file
+files/filetest.txt
+>>> TestInstanceRequiredFileForm = form_for_instance(required_file_instance)
+>>> instance_required_fileform = TestInstanceRequiredFileForm(auto_id=False)
+>>> instance_required_fileform.as_ul()
+u'<li>Description: <input type="text" name="description" value="FileField test" maxlength="50" /></li>\\n<li>File: Currently: files/filetest.txt<br/>Change: <input type="file" name="file_file" /> <input type="hidden" name="file" value="files/filetest.txt" /></li>'
+>>> required_file_instance.delete()
+
+Bad data test
+>>> filled_required_fileform=TestRequiredFileForm(no_file_form_data)
+>>> filled_required_fileform.is_valid()
+False
+>>> print filled_required_fileform.errors
+<ul class="errorlist"><li>file<ul class="errorlist"><li>This field is required.</li></ul></li></ul>
+>>> TestNotRequiredFileForm = form_for_model(NotRequiredFile)
+>>> filled_not_required_fileform=TestNotRequiredFileForm(no_file_form_data)
+>>> filled_not_required_fileform.is_valid()
+True
+>>> filled_not_required_fileform=TestNotRequiredFileForm(bad_encoding_form_data)
+>>> print filled_not_required_fileform.errors
+<ul class="errorlist"><li>file<ul class="errorlist"><li>No file was submitted. Check the encoding type on the form.</li></ul></li></ul>
+>>> filled_not_required_fileform=TestNotRequiredFileForm(just_path_form_data)
+>>> filled_not_required_fileform.is_valid()
+True
+>>> filled_required_fileform=TestRequiredFileForm(just_path_form_data)
+>>> filled_required_fileform.is_valid()
+True
 None
 >>> f.clean('')
 >>> f.clean('1')
Index: tests/regressiontests/forms/tests.py
===================================================================
--- tests/regressiontests/forms/tests.py	(revision 4664)
+++ tests/regressiontests/forms/tests.py	(working copy)
@@ -165,27 +165,11 @@
 # FileInput Widget ############################################################
 
 >>> w = FileInput()
->>> w.render('email', '')
-u'<input type="file" name="email" />'
->>> w.render('email', None)
-u'<input type="file" name="email" />'
->>> w.render('email', 'test@example.com')
-u'<input type="file" name="email" value="test@example.com" />'
->>> w.render('email', 'some "quoted" & ampersanded value')
-u'<input type="file" name="email" value="some &quot;quoted&quot; &amp; ampersanded value" />'
->>> w.render('email', 'test@example.com', attrs={'class': 'fun'})
-u'<input type="file" name="email" value="test@example.com" class="fun" />'
+>>> w.render('file', '')
+u'<input type="file" name="file_file" />'
+>>> w.render('file', 'file/filetest.txt')
+u'Currently: file/filetest.txt<br/>Change: <input type="file" name="file_file" /> <input type="hidden" name="file" value="file/filetest.txt" />'
 
-You can also pass 'attrs' to the constructor:
->>> w = FileInput(attrs={'class': 'fun'})
->>> w.render('email', '')
-u'<input type="file" class="fun" name="email" />'
->>> w.render('email', 'foo@example.com')
-u'<input type="file" class="fun" value="foo@example.com" name="email" />'
-
->>> w.render('email', 'ŠĐĆŽćžšđ', attrs={'class': 'fun'})
-u'<input type="file" class="fun" value="\u0160\u0110\u0106\u017d\u0107\u017e\u0161\u0111" name="email" />'
-
 # Textarea Widget #############################################################
 
 >>> w = Textarea()
