title: tkinter upload image and save it to local directory
body: <p>I want the user to select a file an then save it on a local directory.</p>
  <p>This is my current code.</p>
  <pre><code>def open_file(self):
      curr_directory = os.getcwd()
      self.file_path = askopenfilename(initialdir=curr_directory, title=&quot;Select Image&quot;, filetypes=[('Image Files', '*.jpg')])
      if self.file_path is not None:
          pass
  
  def uploadFiles(self):
      curr_directory = os.getcwd()
      os.chdir(curr_directory + &quot;/images&quot;)
  
      completeName = os.path.join(os.getcwd(), &quot;test.jpg&quot;)
  
      file = open(self.file_path, 'r')
  
      file1 = open(completeName, &quot;w&quot;)
      file1.write(file.read())
      file.close()
      file1.close()
      os.chdir(curr_directory)
  </code></pre>
  <p>Although it creates the file, it is empty. Any help?</p>