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

How to download a big file from s3 ? #990

Closed
ahmad-alkheat opened this issue Nov 9, 2015 · 2 comments
Closed

How to download a big file from s3 ? #990

ahmad-alkheat opened this issue Nov 9, 2015 · 2 comments
Assignees
Labels
feature-request A feature should be added or improved.

Comments

@ahmad-alkheat
Copy link

Currently s3.get_object is freezing and not returning anything because the file is too big, is there a way to go around this?

Thanks

@awood45 awood45 added feature-request A feature should be added or improved. Version 2 labels Nov 9, 2015
@awood45 awood45 self-assigned this Nov 9, 2015
@awood45
Copy link
Member

awood45 commented Nov 9, 2015

You can work around this by making ranged requests to the large object and reassembling the parts.

Here's one example:

client = Aws::S3::Client.new
part = "bytes=0-4999"
resp = client.get_object(bucket: bucket, key: key, range: part)

This will get 5000 bytes of the object, and you could do this (with larger blocks) sequentially for the full size of the object.

That's the workaround, I'm also working on putting something like this together as an SDK feature that compliments multipart uploads.

@ahmad-alkheat
Copy link
Author

@awood45 Thanks a bunch, that makes sense.

@awood45 awood45 reopened this Nov 10, 2015
@awood45 awood45 closed this as completed Nov 10, 2015
awood45 added a commit that referenced this issue Nov 11, 2015
awood45 added a commit that referenced this issue Nov 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants