title: Store file to local server with pysmb
body: <p>I'm writing a script to sync a folder with a shared folder on a local synology nas. I am able to connect, read the files, and remove no problem but am stucking at copy (storefile).</p>
  
  <p>The docs from pysmb are this</p>
  
  <pre><code>storeFile(service_name, path, file_obj, timeout=30)
    Store the contents of the file_obj at path on the service_name. If 
    the file already exists on the remote server, it will be truncated 
    and overwritten.
  
  Parameters: 
    service_name (string/unicode) – the name of the shared folder for the 
   path
   path (string/unicode) – Path of the file on the remote server. If the 
   file at path does not exist, it will be created. Otherwise, it will 
   be overwritten. If the path refers to a folder or the file cannot be 
   opened for writing, an OperationFailure will be raised.
   file_obj – A file-like object that has a read method. Data will read 
   continuously from file_obj until EOF.
  
   Returns:   
   Number of bytes uploaded
  </code></pre>
  
  <p>I can't seem to pass the correct type of file obj. The main error I'm receiving is this</p>
  
  <pre><code>smb.smb_structs.OperationFailure: Failed to store  on andrews-itunes: Unable to open file
  </code></pre>
  
  <p>Here is my attempt</p>
  
  <pre><code>    with open(start_path + f, 'rb', buffering=0) as file_obj:
          conn.storeFile(server_path, '/', file_obj)
      file_obj.closed
  </code></pre>
  
  <p>I also tried using io.BYTESIO. From my conclusion is that I have to pass a byte object without opening it already because it tries to do that, but how could I get that byte file from drive? Any ideas?</p>