title: How to upload the csv into my folder in s3 bucket?
body: <p>My requirement is I want to upload the csv file from localhost to my folder in s3 bucket but I don't have any idea of how to give the folder name in the below code.
  Can somebody help me with this?</p>
  
  <pre><code>import boto3
  import os
  
  def upload_files(path):
      session = boto3.Session(
          aws_access_key_id='',
          aws_secret_access_key='',
          region_name='us-east-1'
      )
      s3 = session.resource('s3')
      bucket = s3.Bucket('ag-tpch')
  
      for subdir, dirs, files in os.walk(path):
          for file in files:
              full_path = os.path.join(subdir, file)
              with open(full_path, 'rb') as data:
                  bucket.put_object(Key=full_path[len(path)+1:], Body=data)
  
  if __name__ == "__main__":
      upload_files('E:/expenses/shape')
  </code></pre>