I have a table in which I have a blob column containing some data, how can i download the blob content in django? I tried the solution mentioned here but it didn't work for me
Asked
Active
Viewed 2,302 times
5
-
What format do you want it in? – Jul 29 '13 at 11:50
1 Answers
6
def download_blob(request, id):
contents = BlobModel.objects.get(id=id).blob_field
response = HttpResponse(contents)
response['Content-Disposition'] = 'attachment; filename=blob.bin'
return response

Thomas
- 11,757
- 4
- 41
- 57