mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Raise ParseError if can't handle the uploaded file
This commit is contained in:
parent
e36e4f48ad
commit
a514232815
|
@ -269,6 +269,7 @@ class FileUploadParser(BaseParser):
|
||||||
file_obj = handler.file_complete(counters[i])
|
file_obj = handler.file_complete(counters[i])
|
||||||
if file_obj:
|
if file_obj:
|
||||||
return DataAndFiles(None, {'file': file_obj})
|
return DataAndFiles(None, {'file': file_obj})
|
||||||
|
raise ParseError("FileUpload parse error - none of upload handlers can handle the stream")
|
||||||
|
|
||||||
def get_filename(self, stream, media_type, parser_context):
|
def get_filename(self, stream, media_type, parser_context):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user