title: Python flask upload file but do not save and use
body: <p>My code currently takes in a file, and saves it to a preset directory, but is it possible to just use the file (read the file) and not save it?</p>
  
  <pre><code>@app.route('/', methods=['GET', 'POST'])
  def upload_file():
      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))
              return "yatta"
          else:
              return "file not allowed"
  
      return render_template("index.html")
  </code></pre>
  
  <p>I have tried both </p>
  
  <p>file.read() and file.stream.read() but the return value of that is empty. I verify that the file exists in the uploaded directory and see that the file is not empty. </p>