当前位置:网站首页>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
边栏推荐
- 软件测试界的三无简历,企业拿什么来招聘你,石沉大海的简历
- DataX self check error /datax/plugin/reader/_ drdsreader/plugin. Json] does not exist
- Oracle time display adjustment
- Sharing of source code anti disclosure scheme under burning scenario
- [nonlinear control theory]9_ A series of lectures on nonlinear control theory
- Data governance: metadata management
- How to estimate the number of threads
- 数据治理:误区梳理篇
- http缓存,强制缓存,协商缓存
- Database addition, deletion, modification and query
猜你喜欢
烧录场景下的源代码防泄密方案分享
How to prevent Association in cross-border e-commerce multi account operations?
【T31ZL智能视频应用处理器资料】
Three no resumes in the software testing industry. What does the enterprise use to recruit you? Shichendahai's resume
Simulation of holographic interferogram and phase reconstruction of Fourier transform based on MATLAB
Interview Reply of Zhuhai Jinshan
【Redis】NoSQL数据库和redis简介
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Solution: intelligent site intelligent inspection scheme video monitoring system
ROS learning (IX): referencing custom message types in header files
随机推荐
TS 类型体操 之 循环中的键值判断,as 关键字使用
Mex related learning
Brief explanation of instagram operation tips in 2022
How to estimate the number of threads
Leecode-c language implementation -15 Sum of three ----- ideas to be improved
Comparison of usage scenarios and implementations of extensions, equal, and like in TS type Gymnastics
继电反馈PID控制器参数自整定
Data governance: 3 characteristics, 4 transcendence and 3 28 principles of master data
Epoll and IO multiplexing of redis
22. Empty the table
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
TS 体操 &(交叉运算) 和 接口的继承的区别
onie支持pice硬盘
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
软件开发的一点随记
Transformer principle and code elaboration
In the era of digital economy, how to ensure security?
649. Dota2 Senate
http缓存,强制缓存,协商缓存
数据治理:微服务架构下的数据治理