hontrang / django

backend
0 stars 0 forks source link

content_type is None when get file from mongodb #9

Closed hontrang closed 7 years ago

hontrang commented 7 years ago
@detail_route(methods=['GET'])
def image(self, request, id=None, *args, **kwargs):
        snippets = Products.objects.get(id=id)
        ch = snippets['imageSource'].readchunk()
        return HttpResponse(ch, content_type="image/jpeg")