mirror of
https://github.com/etesync/server
synced 2024-12-28 02:08:08 +00:00
d8e5c37db1
Merge #65
17 lines
418 B
Python
17 lines
418 B
Python
from rest_framework.parsers import FileUploadParser
|
|
|
|
|
|
class ChunkUploadParser(FileUploadParser):
|
|
"""
|
|
Parser for chunk upload data.
|
|
"""
|
|
|
|
media_type = "application/octet-stream"
|
|
|
|
def get_filename(self, stream, media_type, parser_context):
|
|
"""
|
|
Detects the uploaded file name.
|
|
"""
|
|
view = parser_context["view"]
|
|
return parser_context["kwargs"][view.lookup_field]
|