Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add example for file upload with progress #1868

Merged
merged 1 commit into from
Jun 26, 2018
Merged

add example for file upload with progress #1868

merged 1 commit into from
Jun 26, 2018

Conversation

xinst
Copy link
Contributor

@xinst xinst commented Mar 28, 2018

I added a simple way to track the upload progress, a little trick only

@jasdel
Copy link
Contributor

jasdel commented Jun 26, 2018

Thanks for creating this example @xinst

@jasdel jasdel merged commit 50ba1df into aws:master Jun 26, 2018
xibz pushed a commit to xibz/aws-sdk-go that referenced this pull request Sep 12, 2018
@diehlaws diehlaws added needs-review This issue or pull request needs review from a core team member. and removed review-needed labels Jan 4, 2019
@ibrt
Copy link

ibrt commented Feb 20, 2019

@xinst FYI the example is broken... What happens is that the uploader reads the whole thing twice, haven't dug into why but I think it has to do with determining the number of parts. The first read is very fast as the contents are discarded. The second actually seems to be piped to the upload.

The sample reports progress by dividing the number of bytes read by two, so what I'm seeing is that it jumps straight to 50%, and then proceeds to 100% at half the actual "speed". I "fixed" it by initializing read to -size, starting to report when read passes 0.

@jasdel
Copy link
Contributor

jasdel commented Feb 20, 2019

Thanks for the feedback, @ibrt would you mind creating a Github issue for this bug? I think we should update the original upload progress example to use similar output as the new download progress PR, #2456

@xinst
Copy link
Contributor Author

xinst commented Feb 21, 2019

Thanks for the feedback, @ibrt would you mind creating a Github issue for this bug? I think we should update the original upload progress example to use similar output as the new download progress PR, #2456

that's awesome could display a progress bar in the sample

@xinst
Copy link
Contributor Author

xinst commented Feb 21, 2019

@xinst FYI the example is broken... What happens is that the uploader reads the whole thing twice, haven't dug into why but I think it has to do with determining the number of parts. The first read is very fast as the contents are discarded. The second actually seems to be piped to the upload.

The sample reports progress by dividing the number of bytes read by two, so what I'm seeing is that it jumps straight to 50%, and then proceeds to 100% at half the actual "speed". I "fixed" it by initializing read to -size, starting to report when read passes 0.

I was test with some small(less than 5MB) and large files when I wrote this sample, it was worked for me at that time when divided by two, it was strange. I didn't met the progress straight jumps to 50%.

jasdel pushed a commit that referenced this pull request Mar 1, 2019
Adds a new example to the S3 service's examples. This example shows how you could use the S3's GetObject API call in conjunction with a custom writer keeping track of progress.

Related to #1868, 2468
@aws-sdk-go-automation aws-sdk-go-automation mentioned this pull request Mar 1, 2019
@anacrolix
Copy link

This is an unsound example: It abuses the knowledge that the input is read twice, and should be named putObjectWithProgress, not Process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review This issue or pull request needs review from a core team member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants