juliomalegria / django-chunked-upload

Upload large files to Django in multiple chunks, with the ability to resume if the upload is interrupted.
MIT No Attribution
218 stars 73 forks source link

#DJANGO1.7 TypeError at /api/chunked_upload __init__() got an unexpected keyword argument 'mimetype' #9

Closed madEng84 closed 9 years ago

madEng84 commented 9 years ago

I used django-chunked-upload-demo with Django 1.7 version

Traceback:
File "/Users/macmini1/Workspace/django-chunked-upload-demo/django-chunked-upload-demo-env/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/macmini1/Workspace/django-chunked-upload-demo/django-chunked-upload-demo-env/lib/python2.7/site-packages/django/views/generic/base.py" in view
  69.             return self.dispatch(request, *args, **kwargs)
File "/Users/macmini1/Workspace/django-chunked-upload-demo/django-chunked-upload-demo-env/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
  87.         return handler(request, *args, **kwargs)
File "/Users/macmini1/Workspace/django-chunked-upload-demo/django-chunked-upload-demo-env/lib/python2.7/site-packages/chunked_upload/views.py" in post
  93.             return self._post(request, *args, **kwargs)
File "/Users/macmini1/Workspace/django-chunked-upload-demo/django-chunked-upload-demo-env/lib/python2.7/site-packages/chunked_upload/views.py" in _post
  210.                         status=http_status.HTTP_200_OK)
File "/Users/macmini1/Workspace/django-chunked-upload-demo/django-chunked-upload-demo-env/lib/python2.7/site-packages/chunked_upload/response.py" in __init__
  15.             *args, **kwargs
File "/Users/macmini1/Workspace/django-chunked-upload-demo/django-chunked-upload-demo-env/lib/python2.7/site-packages/django/http/response.py" in __init__
  318.         super(HttpResponse, self).__init__(*args, **kwargs)

Exception Type: TypeError at /api/chunked_upload
Exception Value: __init__() got an unexpected keyword argument 'mimetype'

It could be resolved not passing the mimetype to django.http.HttpResponse class

juliomalegria commented 9 years ago

Thanks for the feedback! I fixed it changing mimetype to content_type. The settings CHUNKED_UPLOAD_MIMETYPE also changed to CHUNKED_UPLOAD_CONTENT_TYPE (although the previous one is still accepted).

New version 1.0.3 available on PyPI including this fix.