当前位置:网站首页>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
边栏推荐
- C # display the list control, select the file to obtain the file path and filter the file extension, and RichTextBox displays the data
- Launch APS system to break the problem of decoupling material procurement plan from production practice
- How to estimate the number of threads
- How to delete all the words before or after a symbol in word
- JMeter performance test steps practical tutorial
- 23. Update data
- Wonderful use of TS type gymnastics string
- Interview Reply of Zhuhai Jinshan
- Le chemin du navigateur Edge obtient
- 数据治理:数据质量篇
猜你喜欢
Simulation of Teman green interferometer based on MATLAB
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
Interview Reply of Zhuhai Jinshan
[1. Delphi foundation] 1 Introduction to Delphi Programming
TS 类型体操 之 extends,Equal,Alike 使用场景和实现对比
datax自检报错 /datax/plugin/reader/._drdsreader/plugin.json]不存在
[redis] Introduction to NoSQL database and redis
When the Jericho development board is powered on, you can open the NRF app with your mobile phone [article]
Mex related learning
22. Empty the table
随机推荐
Redis builds clusters
[dictionary tree] [trie] p3879 [tjoi2010] reading comprehension
Do you really think binary search is easy
CF1036C Classy Numbers 题解
TS 体操 &(交叉运算) 和 接口的继承的区别
Brief explanation of instagram operation tips in 2022
leecode-C語言實現-15. 三數之和------思路待改進版
智能终端设备加密防护的意义和措施
Mex related learning
Entity class design for calculating age based on birthday
opencv学习笔记九--背景建模+光流估计
649. Dota2 Senate
洛谷P1836 数页码 题解
The difference between TS Gymnastics (cross operation) and interface inheritance
Emo diary 1
After the hot update of uniapp, "mismatched versions may cause application exceptions" causes and Solutions
Webrtc series-h.264 estimated bit rate calculation
[KMP] template
解决方案:智慧工地智能巡檢方案視頻監控系統
Get the path of edge browser