Skip to content

Commit

Permalink
Change object name to use only filename (#2654)
Browse files Browse the repository at this point in the history
  • Loading branch information
EndermanAPM committed Aug 11, 2021
1 parent 2047c06 commit 9917d41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/source/guide/s3-uploading-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and uploading each chunk in parallel.
import logging
import boto3
from botocore.exceptions import ClientError
import os
def upload_file(file_name, bucket, object_name=None):
Expand All @@ -38,7 +39,7 @@ and uploading each chunk in parallel.
# If S3 object_name was not specified, use file_name
if object_name is None:
object_name = file_name
object_name = os.path.basename(file_name)
# Upload the file
s3_client = boto3.client('s3')
Expand Down

0 comments on commit 9917d41

Please sign in to comment.