Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fixed #13721 -- Added UploadedFile.content_type_extra. #1301

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Owner

timgraham commented Jun 24, 2013

Thanks Waldemar Kornewald and mvschaik for work on the patch.

Fixed #13721 -- Added UploadedFile.content_type_extra.
Thanks Waldemar Kornewald and mvschaik for work on the patch.
Contributor

kagiasoldaccount commented Jul 11, 2013

not sure where I am meant to post my changes, here or in a fork, so I'll just post them here.

Everything looks good, although i found the view that served the file_uploads test hard to read. so my suggestion is:

extra_params = {}
for field_name, uploadedfile in request.FILES.items():
    extra_params[field_name] = dict([ (k, smart_str(v)) for k, v in uploadedfile.content_type_extra.items()])
return HttpResponse(json.dumps(extra_params))

then in the docs, if felt I'd left out an explanation of exactly what the developer should expect content_type_extra to contain. so my suggestion is:

``content_type_extra`` is extra information usually provided by services
  that intercept and handle file uploads on your behalf. As a result your
  handler may not receive the uploaded file content, but instead a url or
  other pointer.
  (see `RFC 2388`_ section 5.3).

    .. _RFC 2388: http://www.ietf.org/rfc/rfc2388.txt
Owner

timgraham commented Jul 11, 2013

Thanks, incorporated your suggestions and merged in b0953dc.

@timgraham timgraham closed this Jul 11, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment