Download multiple images with one click - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Download multiple images with one click (/thread-12798.html) |
Download multiple images with one click - andie31 - Sep-13-2018 Hey guys, I've solve my last problem with help from @perfringo ! (https://python-forum.io/Thread-Download-multiple-images-and-rename-them?pid=57947#pid57947) Now I've got into another problem. How do I download multiple images with just one click ? In html. I'm creating a web app based on flask. So my run.py file is looking like this : from flask import Flask, jsonify, render_template, request app = Flask(__name__) @app.route('/') def index(): return render_template('index.html') @app.route('/generate', methods=['GET']) def generate(): prefix = request.args.get('prefix') urls = [] for number in range(1, 7): urls.append('https://example.com/{p}-{n}.jpg'.format(p=prefix, n=number)) return jsonify(result=urls)and my index.html is looking like this : <!doctype html> So the user will input a code, and the form will generate 6 urls. Now I have no idea how to download them all using Javascript and jquery or something else. Any help is appreciated. |