问题
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
回答1:
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
来源:https://stackoverflow.com/questions/17923139/how-to-download-data-in-a-blob-field-from-database-in-django