title: Reading multiple files in flask submitted through a single button from multiple forms
body: <p>I have created a page which has multiple forms and one submit button and the code I have used to submit all the files is:</p>
  
  <pre><code>&lt;form action="" method="POST" id="form1" enctype="multipart/form-data"&gt;
                  &lt;input type="file" id="form1"/&gt;
  
    &lt;form action="" method="POST" id="form2" enctype="multipart/form-data"&gt;
                  &lt;input type="file" id="form2"/&gt;
  
    &lt;form action="" method="POST" id="form3" enctype="multipart/form-data"&gt;
                  &lt;input type="file" id="form3"/&gt;
  
   &lt;input type="button" value='Generate Report' onclick="submitForms()"/&gt;
  </code></pre>
  
  <p>And for submitting the button:          </p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
  
  function submitForms() {
  
  $("#form1").submit();
  $("#form2").submit();
  $("#form3").submit();
   }
  </code></pre>
  
  <p></p>
  
  <p>But when I'm trying to read the files through flask, I'm getting this error:</p>
  
  <blockquote>
    <p>werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser
    (or proxy) sent a request that this server could not understand.</p>
  </blockquote>
  
  <p>My flask code:</p>
  
  <pre><code>@app.route("/upload/",methods=['GET','POST'])
  def upload():
  if request.method=='POST':
      f=request.files['form1']
      p=read.excel(f)
      return str(p.shape)
  return render_template('upload.html')
  </code></pre>