title: Telegram API sendPhoto gives back "Bad Request: type of file mismatch"
body: <p>I'm trying to upload a photo using telepot python library in a telegram bot.</p>
  
  <pre><code>fd, path = tempfile.mkstemp()
  
  image_bytes = requests.get(url=fileUrl, stream=True)
  with open(path, 'wb') as strm:
     for chunk in image_bytes:
        strm.write(chunk)
  
  photoFile = open(path, mode='rb') 
  fileId = bot.sendPhoto(chat_id='chat_id', photo=photoFile)
  
  </code></pre>
  
  <p>This code gives me this error:</p>
  
  <pre><code>telepot.exception.TelegramError: ('Bad Request: type of file mismatch', 400, {'ok': False, 'error_code': 400, 'description': 'Bad Request: type of file mismatch'})
  
  </code></pre>
  
  <p>If I try to access to the local file created by tempfile.mkstemp(), it exists and gives the correct image. 
  I also tried specifying the extension of the image in the image name but there is still the same error.</p>
  
  <p>Thanks for your help</p>