コード例 #1
0
ファイル: views.py プロジェクト: mchampanis/core-hq
def get(request, version, build_number, path):
    build = CommCareBuild.get_build(version, build_number)
    file = build.fetch_file(path)

    response = HttpResponse(file)
    response['Content-Disposition'] = "attachment; filename=%s" % path.split("/")[-1]
    return response
コード例 #2
0
def get(request, version, build_number, path):
    build = CommCareBuild.get_build(version, build_number)
    try:
        file = build.fetch_file(path)
    except ResourceNotFound:
        raise Http404()

    response = HttpResponse(file)
    response['Content-Disposition'] = "attachment; filename=%s" % path.split("/")[-1]
    return response