title: Django 'File' object has no attribute 'content_type'
body: <p>I am defining a function to create a thumbnail for each image uploaded in the model.
  Below is my code:</p>
  
  <pre><code>def create_thumbnail(self):
       if not self.coverphoto:
           return
  
       from PIL import Image
       from cStringIO import StringIO
       from django.core.files.uploadedfile import SimpleUploadedFile
       import os
  
       # Set our max thumbnail size in a tuple (max width, max height)
       THUMBNAIL_SIZE = (200,200)
  
       DJANGO_TYPE = self.coverphoto.file.content_type
  
       if DJANGO_TYPE == 'image/jpeg':
           PIL_TYPE = 'jpeg'
           FILE_EXTENSION = 'jpg'
       elif DJANGO_TYPE == 'image/png':
           PIL_TYPE = 'png'
           FILE_EXTENSION = 'png'
       elif DJANGO_TYPE == 'image/gif':
           PIL_TYPE = 'gif'
           FILE_EXTENSION = 'gif'
  
       # Open original photo which we want to thumbnail using PIL's Image
       image = Image.open(StringIO(self.coverphoto.read()))
  
       image.thumbnail(THUMBNAIL_SIZE, Image.ANTIALIAS)
  
       # Save the thumbnail
       temp_handle = StringIO()
       image.save(temp_handle, PIL_TYPE)
       temp_handle.seek(0)
  
       # Save image to a SimpleUploadedFile which can be saved into
       # ImageField
       suf = SimpleUploadedFile(os.path.split(self.coverphoto.name)[-1],
               temp_handle.read(), content_type=DJANGO_TYPE)
       # Save SimpleUploadedFile into image field
       self.coverphoto_thumbnail.save('%s_thumbnail.%s'%(os.path.splitext(suf.name)[0],FILE_EXTENSION), suf,save=False)
  </code></pre>
  
  <p>When I run the unit test, it show error:</p>
  
  <pre><code>'File' object has no attribute 'content_type'
  </code></pre>
  
  <p>And the indicated error line is:</p>
  
  <pre><code>DJANGO_TYPE = self.coverphoto.file.content_type 
  </code></pre>
  
  <p>Since I get this block of code from an old django snippet. I think this might be caused by different django version.</p>
  
  <p>May I know how can I check content_type in the Django 1.6?</p>
  
  <p>Is there a good way to solve the problem?</p>
  
  <p>Thanks.</p>