file = open(dnldbl.content.path,'r') response = HttpResponse(content = file.read(), content_type=dnldbl.mimetype) response['Content-Length'] = os.path.getsize(dnldbl.content.path) response['Content-Disposition'] = "attachment; filename=%s" % os.path.basename(dnldbl.content.path) return response
Немає коментарів:
Дописати коментар