alican / django-tus

Django app implementing server side of tus protocol to powering resumable file uploads for django projects. More Info about: http://tus.io/
MIT License
49 stars 32 forks source link

Enhancement: Request for metadata extraction code to be available via a function #10

Closed RubenGarcia closed 4 years ago

RubenGarcia commented 4 years ago

Description

The following code from views.py is useful on its own; it would be good to have it in its own exported function.

upload_metadata = request.META.get("HTTP_UPLOAD_METADATA", None)
metadata = {}
if upload_metadata:
        for kv in upload_metadata.split(","):
            (key, value) = kv.split(" ")
            metadata[key] = base64.b64decode(value).decode("utf-8")
alican commented 4 years ago

I'm working right now on the code and I already excludet lots of things to own method. I will push in the hours my actual state to the 3.x branch.

alican commented 4 years ago

implemented with recent updates