title: Attribute Error to send pictures on a FTP server with Python and ftplib
body: <p>I'm actually trying to send pictures(.jpg) saved on a directory of my computer to a FTP server with a python script and ftplib .
  The path where are the images is : "D:/directory_image".
  I use python 2.7 and the command .storbinary from ftplib to send .jpg.
  Despite my search, I get an error message that I can't resolve : </p>
  
  <pre><code>`AttributeError: 'str' object has no attribute 'storbinary'
  </code></pre>
  
  <p>Here's the part of my code that cause problems :</p>
  
  <pre><code>from ftplib import FTP
  import time
  import os
  
  ftp = FTP('Host')
  connect= ftp.login('user', 'passwd')
  path = "D:/directory_image"
  FichList = os.listdir( path )
  i = len(FichList)
  u = 0
  
  While u &lt; i :
      image_name= FichList[u]
      jpg_to_send = path + '/' + image_name
      file_open = open (image_name, 'rb')
      connect.storbinary('STOR '+ jpg_to_send, file_open)
      file_open.close()
      u = u + 1
  </code></pre>
  
  <p>I know that the file argument in Storbinary () must be an open file object instead of a string... But it's an open file object in my script, isn't it?</p>
  
  <p>Thanks a lot,</p>
  
  <p>Clara</p>