Skip to content

GetBytesTotalSize() < GetBytesTransferred() when uploading file to S3 #3329

Answered by sbiscigl
CuteCuteForever asked this question in Q&A
Discussion options

You must be logged in to vote

Does the extra bytes due to chunking ? or request header metadata?

ah sorry, this is correct, it is due to the chunked encoding of the body. so the amount of bytes transferred should be the file size + size of chunked headers and trailer. so thae assertion that the uploaded file bytes == file size is no longer valid. "uploaded byes" will refer to the actual byte stream including the headers. so if we update the assertion to something like

#include <aws/core/Aws.h>
#include <aws/core/utils/threading/PooledThreadExecutor.h>
#include <aws/transfer/TransferManager.h>

#include <fstream>

using namespace Aws;
using namespace Aws::Auth;
using namespace Aws::Client;
using namespace Aws::S3;
using

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
5 replies
@CuteCuteForever
Comment options

@sbiscigl
Comment options

@CuteCuteForever
Comment options

@sbiscigl
Comment options

Answer selected by sbiscigl
Comment options

You must be logged in to vote
2 replies
@sbiscigl
Comment options

@CuteCuteForever
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants