title: FileUploadParser doesn't get the file name
body: <p>I just want to create a REST API that receives a file, process it and return some information. My problem is that I am following this example:
  <a href="http://www.django-rest-framework.org/api-guide/parsers/#fileuploadparser" rel="noreferrer">http://www.django-rest-framework.org/api-guide/parsers/#fileuploadparser</a> </p>
  
  <p>And I can't make it work using Postman or curl, I think I am missing something. The parser always gives me these two errors:</p>
  
  <ul>
  <li>FileUpload parse error - none of upload handlers can handle the stream</li>
  <li>Missing filename. Request should include a Content-Disposition header with a filename parameter. </li>
  </ul>
  
  <p>This is the code:</p>
  
  <p>views.py:</p>
  
  <pre><code>class FileUploadView(APIView):
      parser_classes = (FileUploadParser,)
  
      def post(self, request, filename, format=None):
          file_obj = request.data['file']
          # ...
          # do some stuff with uploaded file
          # ...
          return Response(status=204)
  
      def put(self, request, filename, format=None):
          file_obj = request.data['file']
          # ...
          # do some stuff with uploaded file
          # ...
          return Response(status=204)
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>urlpatterns = [
     url(r'predict/(?P&lt;filename&gt;[^/]+)$', app.views.FileUploadView.as_view())
  ]
  </code></pre>
  
  <p>settings.py</p>
  
  <pre><code>"""
  Django settings for GenderAPI project.
  
  Generated by 'django-admin startproject' using Django 1.9.1.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/1.9/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/1.9/ref/settings/
  """
  
  import os
  import posixpath
  
  
  LOGGING = {
      'version': 1,
      'disable_existing_loggers': False,
      'handlers': {
          'file': {
              'level': 'DEBUG',
              'class': 'logging.FileHandler',
              'filename': 'debug.log',
          },
      },
      'loggers': {
          'django': {
              'handlers': ['file'],
              'level': 'DEBUG',
              'propagate': True,
          },
      },
  }
  
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = removed
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  ALLOWED_HOSTS = ['localhost','127.0.0.1']
  
  REST_FRAMEWORK = {
      'DEFAULT_PARSER_CLASSES': (
          'rest_framework.parsers.FileUploadParser'
      )
  }
  
  
  # Application definition
  
  INSTALLED_APPS = [    
  
      # Add your apps here to enable them
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',   
      'rest_framework',
      'app'  
  
  
  ]
  
  MIDDLEWARE = [
  
      'django.middleware.security.SecurityMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware'
  ]
  
  ROOT_URLCONF = 'GenderAPI.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [],
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'GenderAPI.wsgi.application'
  
  # Database
  # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
      }
  }
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/1.9/howto/static-files/
  
  STATIC_URL = '/static/'
  STATIC_ROOT = posixpath.join(*(BASE_DIR.split(os.path.sep) + ['static']))
  
  FILE_UPLOAD_TEMP_DIR = BASE_DIR
  MEDIA_URL  = '/media/'
  </code></pre>
  
  <p>Here you can see a postman capture (I have tried everything):</p>
  
  <pre><code>PUT /predict/pabloGrande.jpg HTTP/1.1
  Host: 127.0.0.1:52276
  Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
  
  ------WebKitFormBoundary7MA4YWxkTrZu0gW
  Content-Disposition: form-data; name="file"; filename="04320cf.jpg"
  Content-Type: image/jpeg
  
  
  ------WebKitFormBoundary7MA4YWxkTrZu0gW--
  </code></pre>
  
  <p>requirements:</p>
  
  <pre><code>bleach==1.5.0
  Django==1.11.6
  djangorestframework==3.7.1
  html5lib==0.9999999
  Markdown==2.6.9
  numpy==1.13.3
  olefile==0.44
  pandas==0.20.3
  Pillow==4.3.0
  pip==9.0.1
  protobuf==3.4.0
  python-dateutil==2.6.1
  pytz==2017.2
  scipy==1.0.0rc1
  setuptools==28.8.0
  six==1.11.0
  tensorflow==1.3.0
  tensorflow-tensorboard==0.1.8
  Werkzeug==0.12.2
  wheel==0.30.0
  </code></pre>
  
  <p>Thanks so much for your help</p>