【问题标题】:Content-Disposition header Azure HTTP trigger functionContent-Disposition 标头 Azure HTTP 触发函数
【发布时间】:2021-07-20 00:01:21
【问题描述】:

基本上,我试图从 HTTP 触发的 azure 函数获取 excel 作为响应

response = func.HttpResponse(data, mimetype='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename="test.xlsx"'
return response

但是 Content -Disposition 没有标头

【问题讨论】:

    标签: python-3.x azure azure-functions xlsx azure-http-trigger


    【解决方案1】:

    请尝试使用此代码:

    response = func.HttpResponse(fileContent, headers={'Content-Disposition':'attachment; filename="test.xlsx"'}, mimetype='application/vnd.ms-excel')
    

    【讨论】:

      猜你喜欢
      • 2010-11-03
      • 1970-01-01
      • 2012-02-27
      • 1970-01-01
      • 2011-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多