title: Flask upload cannot find directory in server
body: <p>I have problem with Flask upload in local machine code are working but when upload code to server using apache show error </p>
  
  <blockquote>
    <p>IOError: [Errno 2] No such file or directory:
    u'app/static/avatars/KHUON.S.png'</p>
  </blockquote>
  
  <p>Code :</p>
  
  <pre><code>ALLOWED_EXTENSIONS                  =   set(['png', 'jpg', 'jpeg', 'gif'])
  app.config['UPLOAD_FOLDER']         =   'app/static/avatars'
  app.config['MAX_CONTENT_LENGTH']    =   1 * 600 * 600
  
  def allowed_file(filename):
      return '.' in filename and filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS
  
  @app.route('/User/Profile', methods=['GET', 'POST'])
  def upload_profile():
  
      if request.method == 'POST':
  
          file = request.files['file']
          if file and allowed_file(file.filename):
              filename = secure_filename(file.filename)
  
              file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
  
          else:
  
              flash("File extension not allow.")
              return redirect(url_for('upload_profile', upload='error'))
  
      return render_template("profile.html")
  </code></pre>