title: Track download progress of S3 file using boto3 and callbacks
body: <p>I am trying to download a text file from S3 using boto3.</p>
  
  <p>Here is what I have written.</p>
  
  <pre><code>class ProgressPercentage(object):
      def __init__(self, filename):
          self._filename = filename
          self._size = float(os.path.getsize(filename))
          self._seen_so_far = 0
          self._lock = threading.Lock()
  
      def __call__(self, bytes_amount):
          # To simplify we'll assume this is hooked up
          # to a single filename.
          with self._lock:
              self._seen_so_far += bytes_amount
              percentage = round((self._seen_so_far / self._size) * 100,2)
              LoggingFile('{} is the file name. {} out of {} done. The percentage completed is {} %'.format(str(self._filename), str(self._seen_so_far), str(self._size),str(percentage)))
              sys.stdout.flush()
  </code></pre>
  
  <p>and I am calling it using</p>
  
  <pre><code>transfer.download_file(BUCKET_NAME,FILE_NAME,'{}{}'.format(LOCAL_PATH_TEMP , FILE_NAME),callback = ProgressPercentage(LOCAL_PATH_TEMP + FILE_NAME))
  </code></pre>
  
  <p>this is giving me a error that file is not present in the folder. Apparently when I already have a file with this name in the same folder it works but when I am downloading a fresh file , it errors out.</p>
  
  <p>What is correction I need to make?</p>