当前位置:网站首页>Flash return file download
Flash return file download
2022-07-06 07:51:00 【nongcunqq】
from flask import Flask, send_from_directory
import os
app = Flask(__name__)
@app.route("/download")
def index():
print(os.getcwd())
filename = "1.png"
path = os.path.join(os.getcwd(), filename)
return send_from_directory(path=path, directory=os.getcwd(), filename=filename,as_attachment=True)
# return send_from_directory(path='./upload/upload_cnews.xlsx', directory='./upload', filename='upload_cnews.xlsx',
# as_attachment=True)
Reference resources
https://blog.csdn.net/qq_37754830/article/details/118884561
边栏推荐
- Database addition, deletion, modification and query
- On why we should program for all
- http缓存,强制缓存,协商缓存
- TS 类型体操 之 循环中的键值判断,as 关键字使用
- 智能终端设备加密防护的意义和措施
- Redis builds clusters
- Typescript interface and the use of generics
- C # display the list control, select the file to obtain the file path and filter the file extension, and RichTextBox displays the data
- [cf gym101196-i] waif until dark network maximum flow
- Esrally domestic installation and use pit avoidance Guide - the latest in the whole network
猜你喜欢

Sharing of source code anti disclosure scheme under burning scenario

Force buckle day31

Esrally domestic installation and use pit avoidance Guide - the latest in the whole network

Codeforces Global Round 19(A~D)

解决方案:智慧工地智能巡检方案视频监控系统

Inspiration from the recruitment of bioinformatics analysts in the Department of laboratory medicine, Zhujiang Hospital, Southern Medical University

octomap averageNodeColor函数说明
![[redis] Introduction to NoSQL database and redis](/img/95/229d7a08e94245f2733b8c59201cff.png)
[redis] Introduction to NoSQL database and redis
![[1. Delphi foundation] 1 Introduction to Delphi Programming](/img/14/272f7b537eedb0267a795dba78020d.jpg)
[1. Delphi foundation] 1 Introduction to Delphi Programming

24. Query table data (basic)
随机推荐
TS类型体操 之 字符串的妙用
onie支持pice硬盘
数据治理:主数据的3特征、4超越和3二八原则
Qualitative risk analysis of Oracle project management system
Sharing of source code anti disclosure scheme under burning scenario
实现精细化生产, MES、APS、ERP必不可少
How to prevent Association in cross-border e-commerce multi account operations?
珠海金山面试复盘
Basics of reptile - Scratch reptile
Force buckle day31
Le chemin du navigateur Edge obtient
Nc204382 medium sequence
洛谷P4127 [AHOI2009]同类分布 题解
[window] when the Microsoft Store is deleted locally, how to reinstall it in three steps
Is the super browser a fingerprint browser? How to choose a good super browser?
08- [istio] istio gateway, virtual service and the relationship between them
js對象獲取屬性的方法(.和[]方式)
智能终端设备加密防护的意义和措施
【T31ZL智能视频应用处理器资料】
Games101 Lesson 7 shading 1 Notes