我有一个表,其中有一个包含一些数据的 blob 列,如何在 django 中下载 blob 内容?
我尝试了 here 提到的解决方案,但对我不起作用
最佳答案
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
关于django - 如何从django中的数据库下载blob字段中的数据?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17923139/