Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8674285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:40:20+00:00 2026-06-12T19:40:20+00:00

I am trying to upload a file but the browser spinner rolls forever, server

  • 0

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:-

static/index.html :-

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

app.py

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)

Thanks

Env: Flask 0.9, Jinja2-2.6 and Werkzeug-0.8.3 with Python 2.7 on Win7 x64 with IE9 and Chrome

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:40:21+00:00Added an answer on June 12, 2026 at 7:40 pm

    The docs say you should use enctype="multipart/form-data".

    Also, I might try method="POST" (uppercase), if only because defensive coding is a good habit, the defensive maneuver here being not assuming that Flask is bug-free.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to upload a file to a distant server, but looks like the
When using IE browser and trying to upload file using File.SaveAs method I get
I was trying to upload file(s) using PrototypeJs request method but I failed. The
I'm trying to upload a file .txt in my web space, but then the
I'm trying to upload a file via URLConnection, but I need to read/write it
I'm trying trying to upload a file via Paperclip, but I'm getting an error
I am trying to upload a pdf file using webservice api. But this api
im trying to do a file upload using http post but when I try
I'm trying to upload images to a php file, everything works, but sometimes when
I am trying to upload file to an sharepoint online server using webclient. Up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.