Boto-3 upload_file pushing 0kb file on S3
See original GitHub issueHi Team, I am trying to upload file on S3 using boto3 on python3.6. Its working fine, if uoloaded file size is more than 8kb. But if if file size is smaller than 8kb, its uploading 0kb file on S3. I am bot using any size constraint in my code.
Below is simple script:
import boto3
from boto3.s3.transfer import S3Transfer
client = boto3.client('s3')
transfer = S3Transfer(client)
transfer.upload_file(localKey, app_s3_bucket, s3Key)
print ('SUCCESS! Local File: ' + localKey + ', S3 File: ' + s3Key)
Appreciated your help.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Uploading a file to a S3 bucket with a prefix using Boto3
According to the Boto3 S3 upload_file documentation, you should upload your upload like this: upload_file(Filename, Bucket, Key, ExtraArgs=None, ...
Read more >Uploading files — Boto3 Docs 1.26.34 documentation - AWS
The method handles large files by splitting them into smaller chunks and uploading each chunk in parallel.
Read more >How To Write A File Or Data To An S3 Object Using Boto3
In this tutorial, you'll learn how to write a file to s3 using object.put() or upload_file() or client.putObject() method available in boto3 ......
Read more >Resolve issues with uploading large files in Amazon S3
I'm trying to upload a large file (1 GB or larger) to Amazon Simple Storage Service (Amazon S3) using the console.
Read more >How To Upload File to S3 with the AWS CLI
An AWS S3 bucket. You can use an existing bucket if you'd prefer. Still, it is recommended to create an empty bucket instead....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you add the line
boto3.set_stream_logger('')
at the top of your code and paste the output you get from that here?Closing this issue. If anyone still getting the error with latest version of boto3 please reopen the issue. I would be happy to help.