question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Boto-3 upload_file pushing 0kb file on S3

See original GitHub issue

Hi 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:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
stealthycoincommented, Jul 17, 2017

Can you add the line boto3.set_stream_logger('') at the top of your code and paste the output you get from that here?

0reactions
swetashrecommented, Mar 19, 2020

Closing this issue. If anyone still getting the error with latest version of boto3 please reopen the issue. I would be happy to help.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found