title: Image Classification Using Google Cloud Vision API
body: <p>I have a Flask app in which a user uploads a file and then I make a request to google cloud vision API to classify it.</p>
  <p>I'm doing the following:</p>
  <pre class="lang-py prettyprint-override"><code>@app.route('/cloud_vision', methods=['POST'])
  def cloud_vision():
      files = flask.request.files.getlist('files')
  
      client = vision.ImageAnnotatorClient()
  
      if len(files) &gt; 1 or files[0].filename != '':
          for file in files:
              with io.open(file, 'rb') as image_file:
                  content = image_file.read()
              image = vision.Image(content=content)
              response = client.label_detection(image=image)
              labels = response.label_annotations
              (...)
  </code></pre>
  <p>But im getting this error <code>TypeError: expected str, bytes or os.PathLike object, not FileStorage</code> when opening the file. How can I correct this?</p>