Flask-Uploads IOError: [Errno 2] No such file or directory
<p>So, I've been trying to add an image uploader to my code, but I've been running into issues.  Even though I thought I had my <code>upload_folder</code> configured properly, I keep getting errors like: <code>IOError: [Errno 2] No such file or directory: '/static/uploads/compressor.jpg'</code>  even though the file/directory exists. </p>

<p>Here's the code:</p>

<h2>in config.py</h2>

<pre><code>UPLOAD_FOLDER = 'static/uploads'
</code></pre>

<h2>in <strong>init</strong>.py</h2>

<pre><code>app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
</code></pre>

<h2>in views.py</h2>

<pre><code>@app.route('/fileupload', methods=['GET', 'POST'])
def upload_file():
    if request.method == 'POST':
        #check if the post request has the file part
        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 an empty part without filename
        if file.filename == '':
            flash('No selected file')
            return redirect(request.url)
        if file and allowed_file(file.filename):
            filename = secure_filename(file.filename)
            file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
            return redirect(url_for('uploaded_file',
                                    filename=filename))
    return '''
    &lt;!doctype html&gt;
    &lt;title&gt;Upload new File&lt;/title&gt;
    &lt;h&gt;UPload new file&lt;/h1&gt;
    &lt;form action="" method=post enctype=multipart/form-data&gt;
        &lt;p&gt;&lt;input type=file name=file&gt;
            &lt;input type=submit value=Upload&gt;
    &lt;/form&gt;
    '''

@app.route('/uploads/&lt;filename&gt;')
def uploaded_file(filename):
    return send_from_directory(app.config['UPLOAD_FOLDER'],
                               filename)
</code></pre>

<p>My folder structure is as follows</p>

<pre><code>  /project folder
   --/app
   ----/static
   --------/uploads
   ----/templates
   ----_init__.py
   ----views.py
   --config.py
</code></pre>

<p>When I use /tmp/ to store it in memory the uploader works no problem.  I assume it's not looking in the proper path for my folder.  Can anyone help here?  I'm a very amateur python developer.</p>