title: how to upload multiple files using flask in python
body: <p>Here is my code for multiple files upload:</p>
  
  <p><strong>HTML CODE:</strong></p>
  
  <pre><code>Browse &lt;input type="file" name="pro_attachment1" id="pro_attachment1" multiple&gt;
  </code></pre>
  
  <p><strong>PYTHON CODE:</strong></p>
  
  <pre><code>pro_attachment = request.files.getlist('pro_attachment1')
  
  for upload in pro_attachment:
      filename = upload.filename.rsplit("/")[0]
      destination = os.path.join(application.config['UPLOAD_FOLDER'], filename)
      print "Accept incoming file:", filename
      print "Save it to:", destination
      upload.save(destination)
  </code></pre>
  
  <p>But it uploads a single file instead of multiple files.</p>