当前位置:网站首页>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
边栏推荐
- Comparison of usage scenarios and implementations of extensions, equal, and like in TS type Gymnastics
- Opencv learning notes 9 -- background modeling + optical flow estimation
- 超级浏览器是指纹浏览器吗?怎样选择一款好的超级浏览器?
- Opencv learning notes 8 -- answer sheet recognition
- WebRTC系列-H.264预估码率计算
- Hackathon ifm
- Ble of Jerry [chapter]
- Helm install Minio
- Fundamentals of C language 9: Functions
- Esrally domestic installation and use pit avoidance Guide - the latest in the whole network
猜你喜欢
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
23. Update data
数据治理:主数据的3特征、4超越和3二八原则
数字经济时代,如何保障安全?
[computer skills]
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
智能终端设备加密防护的意义和措施
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
How to prevent Association in cross-border e-commerce multi account operations?
Risk planning and identification of Oracle project management system
随机推荐
What are the ways to download network pictures with PHP
Related operations of Excel
数字经济时代,如何保障安全?
Data governance: 3 characteristics, 4 transcendence and 3 28 principles of master data
Notes on software development
数据治理:误区梳理篇
洛谷P1836 数页码 题解
Nc204382 medium sequence
C intercept string
Luogu p4127 [ahoi2009] similar distribution problem solution
Solution: système de surveillance vidéo intelligent de patrouille sur le chantier
On why we should program for all
解决方案:智慧工地智能巡檢方案視頻監控系統
esRally国内安装使用避坑指南-全网最新
Data governance: misunderstanding sorting
[dictionary tree] [trie] p3879 [tjoi2010] reading comprehension
861. Score after flipping the matrix
MES, APS and ERP are essential to realize fine production
Launch APS system to break the problem of decoupling material procurement plan from production practice
Significance and measures of encryption protection for intelligent terminal equipment