1

我正在尝试从 opa 数据库下载文件。我使用了以下代码:

case {path:[], query:[("download", filename)], ...} : Resource.binary(/myDatabase[filename], "application/txt")

它工作正常,但我下载的文件始终命名为“download.txt”。如何更改此名称?

谢谢

4

1 回答 1

2
case {path:[], query:[("download", filename)], ...} : Resource.binary(/myDatabase[filename], "application/txt") |> Resource.add_header(_, {content_disposition={attachment=filename}})
于 2012-05-08T20:49:54.503 回答