flask file upload not working
<p>I have problem with file upload. I getting no errors but i can't to find file. I was looking for solution but without success. Can anyone help to me?
My code:</p>

<pre><code>UPLOAD_FOLDER = '/upload/'
ALLOWED_EXTENSIONS = set(['.xlsx', '.xls'])
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER

def allowed_file(filename):
  print(filename)
  return '.' in filename and \
       filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS
@app.route('/file_upload', methods=['GET', 'POST'])
def file():
    if request.method == 'POST':
        print(os.getcwd())
        if 'file' not in request.files:
            flash('No file part')
            return redirect(request.url)
        file = request.files['file']
        # if user does not select file, browser also
        # submit a empty part without filename
        if file.filename == '':
            flash('No selected file')
            return redirect(request.url)
        if file and allowed_file(file.filename):
            print(filename)
            filename = secure_filename(file.filename)
            print(filename)
            file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
            return redirect(url_for('uploaded_file', filename=filename))

    return render_template("/file_upload.html", role="ok")
</code></pre>

<p>this is example form <a href="http://flask.pocoo.org/docs/0.11/patterns/fileuploads/" rel="nofollow">Flask Doc</a></p>

<p>Your <code>allowed_extensions</code> function is splitting on <code>"."</code>, i.e. returning sub-strings split by <code>"."</code>, but then <code>ALLOWED_EXTENSIONS</code> still contains <code>"."</code>s.</p>

<p>Replace your <code>ALLOWED_EXTENSIONS</code> with </p>

<pre><code>ALLOWED_EXTENSIONS = set(['xlsx', 'xls'])
</code></pre>

python flask