title: not able to create folders in aws s3 using boto3
body: <p>I want to create a set of folders inside which i want to upload my file in s3 bucket.
  However, i am not getting the required file names.
  This is my code</p>
  <pre><code>s3 = boto3.resource('s3')
  
  def upload_to_aws(local_file, bucket, s3_file):
      s3 = boto3.client('s3', aws_access_key_id=ACCESS_KEY,
                        aws_secret_access_key=SECRET_KEY)
  
      try:
          s3.upload_file(local_file, bucket, s3_file)
          print(&quot;Upload Successful&quot;)
          return True
      except FileNotFoundError:
          print(&quot;The file was not found&quot;)
          return False
      except NoCredentialsError:
          print(&quot;Credentials not available&quot;)
          return False
  
  customer_name = &quot;demo&quot;
  date = datetime.now().strftime('%d')
  month = datetime.now().month
  year = datetime.now().year
  
  
  stack_path = &quot;/home/ubuntu/pano/stack&quot;    
  for file in sorted(os.listdir(stack_path)):
      print(f&quot;Uploading {file}&quot;)
      folders_path = f&quot;{customer_name}/{year}/{month}/{date}&quot;
      uploaded = upload_to_aws(f'/home/ubuntu/pano/stack/{file}', 'bucket-name1', '%s/%s' % (folders_path, file))
  </code></pre>
  <p>I want the folders to be customer_name/year/month/date inside which i want the files ot be uploaded. However the folders i am getting are
  &quot;customer_name/ &quot;
  &quot;year/&quot;
  &quot;month/&quot;
  &quot;date/&quot;
  I do not want the backslash in the folder name. how do i do this?</p>
  <p>Edit</p>
  <p>The folders i want has the following path - year/month/date/filename.txt
  However the path that is being created have the following folder names
  year//month//date//filename.txt</p>
  <p>Each of the folder names has a backslash attached to it. Thesea re the directories i see in my bucket</p>
  <ol>
  <li>year/</li>
  <li>month/</li>
  <li>date/</li>
  </ol>
  <p>I want to avoid the backslash along with the names</p>