title: Cannot Upload Multiple Files to AWS S3 using Python Script and wildcards
body: <p>I am newer to working with python as well as AWS. </p>
  
  <p>I am attempting to move various files "and usually" with specific formats from my local pc to an S3 AWS folder via a python script. I am having an issue with implementing a wildcard within the script to catch various files at once. I am able to move one file at a time using the string "data = open('file_example_here.csv', 'rb')" , though I am stuck on adjusting my python script to capture all (i.e.  .csv or all .json files). An example set of files are detailed below, so if I wanted to move all .json files to my s3 instance using a wildcard in the script how could I go about adjusting my script to handle that ask if possible?. </p>
  
  <p>Any help would really be appreciated , implementation is shared below.</p>
  
  <pre><code>
  /home/user/folder1/c_log_1-10-19.csv
  /home/user/folder1/c_log_2-10-19.csv
  /home/user/folder1/c_log_3-10-19.csv
  /home/user/folder1/c_log_4-10-19.csv
  /home/user/folder1/c_log_5-10-19.csv
  /home/user/folder1/c_log_6-10-19.csv
  
  /home/user/folder1/h_log_1-11-18.json
  /home/user/folder1/h_log_2-11-18.json
  /home/user/folder1/h_log_3-11-18.json
  /home/user/folder1/h_log_4-11-18.json
  /home/user/folder1/h_log_5-11-18.json
  /home/user/folder1/h_log_6-11-18.json
  
  import boto3
  from botocore.client import Config
  
  ACCESS_KEY_ID = 'key_id_here'
  ACCESS_SECRET_KEY = 'secret_key_here'
  BUCKET_NAME = 'bucket_name_here'
  
  data = open('test_file.csv', 'rb')
  
  s3 = boto3.resource(
      's3',
      aws_access_key_id=ACCESS_KEY_ID,
      aws_secret_access_key=ACCESS_SECRET_KEY,
      config=Config(signature_version='s3v4')
  )
  s3.Bucket(BUCKET_NAME).put_object(Key='folder_test/folder_test_2/test_file.csv', Body=data)
  
  print ("All_Done")
  
  
  ````````````````````````````````````````````````````
  ################################################
  ############## UPDATED CODE BELOW ############
  ################################################
  import glob
  import boto3
  from botocore.client import Config
  
  ACCESS_KEY_ID = 'some_key'
  ACCESS_SECRET_KEY = 'some_key'
  BUCKET_NAME = 'some_bucket'
  
  #session = boto3.Session(profile_name='default')
  s3 = boto3.resource(
      's3',
      aws_access_key_id=ACCESS_KEY_ID,
      aws_secret_access_key=ACCESS_SECRET_KEY,
      config=Config(signature_version='s3v4')
  )
  
  csv_files = glob.glob("/home/user/Desktop/*.csv")
  #json_files = glob.glob("/home/user/folder1/h_log_*.json")
  
  for filename in csv_files:
      print("Putting %s" % filename)
      s3.upload_file(filename, BUCKET_NAME, filename)
  
  #for filename in json_files:
  #    print("Putting %s" % filename)
  #    s3.upload_file(filename, BUCKET_NAME, filename)
  
  s3.Bucket(BUCKET_NAME).put_object(Key='folder1/folder1', Body=csv_files)
  
  print("All_Done")
  
  </code></pre>