title: File Upload Hangs with Flask
body: <p>I am trying to upload a file but the browser spinner rolls forever, server logs don't show updates and the file doesn't get uploaded. It sure is a newbie error but I have no clue what that is:-</p>
  
  <p>static/index.html :-</p>
  
  <pre><code>html
  form action="http://127.0.0.1:5000/upload" method="post" enctype="multipart/form-data"
    input type="file" name="db"/
    input type="submit" value="upload"/
  /form
  html
  </code></pre>
  
  <p>app.py</p>
  
  <pre><code>from flask import Flask
  from flask import request
  from werkzeug import secure_filename
  
  app = Flask(__name__)
  
  @app.route('/')
  def hello_world():
      return 'Hello World!'
  
  @app.route('/upload', methods=['GET', 'POST'])
  def upload_file():
      print 'upload_file'
      if request.method == 'POST':
          print 'post'
          f = request.files['db']
          f.save(secure_filename(f.filename))
  
  if __name__ == '__main__':
      app.run(debug=True)
  </code></pre>
  
  <p>Thanks</p>
  
  <p>Env: Flask 0.9, Jinja2-2.6 and Werkzeug-0.8.3 with Python 2.7 on Win7 x64 with IE9 and Chrome</p>