【问题标题】:Plotly Dash: Download local file on button clickPlotly Dash:单击按钮下载本地文件
【发布时间】:2021-11-11 19:30:32
【问题描述】:

我正在尝试将本地文件链接到我的 Dash 按钮,但无法使其正常工作。

我尝试了一些组合,例如关闭'external_link' 标签或将文件放入资产文件夹,但似乎没有任何效果,尽管问题似乎非常简单。我遵循Dash Bootstrap Button documentation 的语法。

我怎样才能把这个文件链接起来?

dbc.Button(
    "download",
    href='xxx.xlsx',
    external_link=True,
    color="primary",
)

【问题讨论】:

    标签: python plotly-dash


    【解决方案1】:

    为愚蠢的问题道歉 - 文件必须在 /static/ 文件夹中才能工作 - 不能只是链接驱动器上的任何随机文件

    【讨论】:

      猜你喜欢
      • 2021-05-01
      • 2020-11-21
      • 1970-01-01
      • 2016-05-10
      • 1970-01-01
      • 2019-04-29
      • 2018-04-06
      • 1970-01-01
      • 2020-07-22
      相关资源
      最近更新 更多