当前位置:网站首页>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
边栏推荐
- [window] when the Microsoft Store is deleted locally, how to reinstall it in three steps
- Force buckle day31
- 解决方案:智慧工地智能巡檢方案視頻監控系統
- MES, APS and ERP are essential to realize fine production
- [nonlinear control theory]9_ A series of lectures on nonlinear control theory
- Get the path of edge browser
- Methods for JS object to obtain attributes (. And [] methods)
- Key value judgment in the cycle of TS type gymnastics, as keyword use
- Related operations of Excel
- Yu Xia looks at win system kernel -- message mechanism
猜你喜欢

leecode-C語言實現-15. 三數之和------思路待改進版

Pangolin Library: control panel, control components, shortcut key settings

Significance and measures of encryption protection for intelligent terminal equipment
![07- [istio] istio destinationrule (purpose rule)](/img/be/fa0ad746a79ec3a0d4dacd2896235f.jpg)
07- [istio] istio destinationrule (purpose rule)

软件测试界的三无简历,企业拿什么来招聘你,石沉大海的简历

数字经济时代,如何保障安全?

Sharing of source code anti disclosure scheme under burning scenario

JMeter performance test steps practical tutorial

继电反馈PID控制器参数自整定

Simulation of Michelson interferometer based on MATLAB
随机推荐
TS 类型体操 之 extends,Equal,Alike 使用场景和实现对比
edge浏览器 路径获得
CF1036C Classy Numbers 题解
http缓存,强制缓存,协商缓存
How to prevent Association in cross-border e-commerce multi account operations?
Force buckle day31
MEX有关的学习
Google可能在春节后回归中国市场。
Opencv learning notes 9 -- background modeling + optical flow estimation
二叉树创建 & 遍历
Opencv learning notes 8 -- answer sheet recognition
Helm install Minio
Data governance: Data Governance under microservice architecture
Luogu p1836 number page solution
QT color is converted to string and uint
数据治理:主数据的3特征、4超越和3二八原则
07- [istio] istio destinationrule (purpose rule)
超级浏览器是指纹浏览器吗?怎样选择一款好的超级浏览器?
MySQL view tablespace and create table statements
In the era of digital economy, how to ensure security?