Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route('/get_file', methods=["GET"])
- def get_file():
- filepath = request.args.get('filepath')
- dirname, fname = os.path.split(filepath)
- return send_from_directory(dirname, fname, as_attachment=True)
- {% for path in data %}
- <img class='lazy' data-src="{{ url_for('get_file', filepath=path) }}">
- {% endfor %}
- import asyncio
- @app.route('/get_file', methods=["GET"])
- async def get_file():
- filepath = request.args.get('filepath')
- dirname, fname = os.path.split(filepath)
- await send_from_directory(dirname, fname, as_attachment=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement