ByteNote LogoByteNote

Navigation

  • Blog
  • 工具

    © 2025 ByteNote. All rights reserved.

    Python flask 静态服务

    Jul 7, 20223 min read
    @app.route('/uploads/<path:filename>')
    def download_file(filename):
        return send_from_directory(app.config['UPLOAD_FOLDER'],
                                   filename, as_attachment=True)
    

    参数说明

    directory – the directory where all the files are stored.
    filename – the filename relative to that directory to download.
    options – optional keyword arguments that are directly forwarded to send_file().

    相关文章

    2023 quantumult x 配置实例

    2023年Quantumult X配置实例,包括网络模式切换、DNS设置、策略组配置、远程和本地服务器及规则订阅等详细配置。

    一百个常用英文网络用语总结

    这份列表包含了100个常用的网络缩写和短语,用于快速沟通和表达各种情感、状态和需求。

    Go 读写互斥锁的使用

    Go 语言中的读写互斥锁(RLock 和 Lock)用于管理并发访问共享资源,确保同一时间只有一个写入操作或多个读取操作,提高程序的并发效率。

    next.js 使用pm2

    使用pm2以"office-web"为名启动next.js应用。

    飞书的在线文档如何导出?

    登录飞书账号,进入文档应用,选择文档并点击“更多”图标,选择导出格式后点击“导出”,即可下载导出的文件。