python - Send PIL Image from Django View to Browser for Download via HttpResponse -
i'm trying send pil image django view browser automatic download. code below seems work many:
response = httpresponse(content_type='image/jpg') pil_imagetosend.save(response, "jpeg") response['content-disposition'] = 'attachment; filename="name.jpg"' return response
i call django view through ajax, , when print callback looks jpeg image, no download triggered. missing download automatically trigger?
Comments
Post a Comment