图片上传和显示 |
上传保存 def save_to_local(file, file_name): file.save(os.path.join(save_dir, file_name)) return '/image/' + file_name 下载显示 @app.route('/image/<image_name>') def view_image(image_name): return send_from_directory(app.config['UPLOAD_DIR'], image_name) |
flask图片上传和下载
最新推荐文章于 2024-07-03 20:17:02 发布