Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Partial downloads (streaming?) #149

Closed
harlantwood opened this issue Nov 25, 2015 · 7 comments
Closed

Partial downloads (streaming?) #149

harlantwood opened this issue Nov 25, 2015 · 7 comments

Comments

@harlantwood
Copy link
Contributor

As a user of the API module, I'd like to download the first 5KB or so of a text file in ipfs, to generate a preview. Can I do this, without downloading the whole file?

@harlantwood
Copy link
Contributor Author

@jacksenechal

@dignifiedquire
Copy link
Contributor

As soon as we have proper header detection (ipfs/kubo#1979) cat will stream. But there is no way to abort requests in the browser (whatwg/fetch#27) so effectively you will always pull down the whole file, unless go-ipfs directly adds a method for just requesting a partial file.

@daviddias
Copy link
Contributor

AFAIK, cat is streaming now, right?

@dignifiedquire
Copy link
Contributor

pretty sure it does yes

@daviddias daviddias removed the discuss label Apr 17, 2016
@daviddias
Copy link
Contributor

@harlantwood You might want to confirm with your use case. Let us know if you hit any roadblock.

@daviddias
Copy link
Contributor

As @dignifiedquire mentioned, you are always able to get the first block (256KiB) through a object.get or block.get request, but that would be that you would implement your how mechanism to fetch. Does that suit you, @harlantwood ?

@harlantwood
Copy link
Contributor Author

Great, I'll close this for now. When I get back to using this directly again, I'll check the progress and reopen if necessary.

Thanks for the work and progress on this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants