Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经使用 Upload 模块将文件保存到 Opa 数据库中。
现在我想从数据库中下载这些文件。我怎样才能做到这一点 ?
任何想法 ?
谢谢,
开曼
你的问题到底是什么?
我想您已经知道如何从数据库中检索值。然后你只需要以这种方式提供这个文件:
url_parser = parser | "/file.pdf" -> Resource.binary(v,"application/pdf")
阅读更多关于Resource.binary和Resource.source here:
Resource.binary
Resource.source here
http://doc.opalang.org/api/#stdlib.core.web.resource.resource.opa.html/!/value_stdlib.core.web.resource.Resource.binary
http://doc.opalang.org/api/#stdlib.core.web.resource.resource.opa.html/!/value_stdlib.core.web.resource.Resource.source