def download_avatar(fname):
if platform.system() == "Windows":
path = UPLOAD_AVATAR_FOLDER + "/" + fname # windows??????????????????????
else:
path = os.path.join(UPLOAD_AVATAR_FOLDER, fname) # ?????
if os.path.isfile(path):
return send_from_directory(UPLOAD_AVATAR_FOLDER, fname, as_attachment=True)
abort(404)
评论列表
文章目录