title: Can I resume a download from aws s3?
body: <p>I am using the python boto3 library to download files from s3 to an IOT device on a cellular connection which is often slow and shaky.</p>
  
  <p>Some files are quite large (250Mb, which for this scenario is large) and the network fails and the device reboots while downloading. </p>
  
  <p>I would like to resume the download from the place it ended when the device rebooted. Is there any way to do it?</p>
  
  <p>The aborted download does seem to keep downloaded data in a temporary file while downloading so the data is there.</p>
  
  <p>The goal is to economize data transfer and make the download more resilient.</p>
  
  <p>I am using multipart uploads but no resume happens by itself.</p>
  
  <p>What i'm doing is something like this:</p>
  
  <pre><code>s3 = boto.resource('s3')
  session = boto.session.Session(region_name='eu-central-1', profile_name=profile)
  s3client = session.client( 's3', config=boto.session.Config(signature_version='s3v4'))
  MB = 1024 ** 2
  
  config = TransferConfig(
      multipart_threshold=10*MB,
      num_download_attempts=100)
  
  def upload():
      s3client.upload_file(Filename=localfile, Bucket=bucket, Key=key, Config=config)
  
  def download():
      s3client.download_file(bucket, key, localfile, Config=config )
  
  # upload from server...
  upload()
  
  # .... later, from IOT device
  download()
  </code></pre>