Peeking Inside Gigantic Zips with Only Kilobytes
ritiksahni.com
Peeking Inside Gigantic Zips with Only Kilobytes
1–10 of 30 posts
Re: Peeking Inside Gigantic Zips with Only Kilobytes
#2Re: Peeking Inside Gigantic Zips with Only Kilobytes
#3[1] https://gildas-lormeau.github.io/zip.js/api/classes/HttpRang...
[2] https://github.com/gildas-lormeau/zip.js/blob/master/tests/a...
Re: Peeking Inside Gigantic Zips with Only Kilobytes
#4I think the general pattern - using the range header + prior knowledge of a file format to only download the parts of a file that are relevant - is still really underutilized.
One small problem I see is that a server that does not support range requests would just try to send you the entire file in the first request, I think.
So maybe doing a preflight HEAD request first to see if the server sends back Accept-Ranges could be useful.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Ran...
Re: Peeking Inside Gigantic Zips with Only Kilobytes
#5https://blog.nella.org/2016/01/17/seeking-http/
(Originally written for Advent of Go.)
Re: Peeking Inside Gigantic Zips with Only Kilobytes
#6Re: Peeking Inside Gigantic Zips with Only Kilobytes
#7Re: Peeking Inside Gigantic Zips with Only Kilobytes
#8For implementation in a library, you can use HttpRangeReader [1][2] in zip.js [3] (disclaimer: I am the author). It's a solid feature that has been in the library for about 10 years. [1] https://gildas-lormeau.github.io/zip.js/api/classes/HttpRang... [2] https://github.com/gildas-lormeau/zip.js/blob/master/tests/a... [3] https://github.com/gildas-lormeau/zip.js
Re: Peeking Inside Gigantic Zips with Only Kilobytes
#9Tangential, but any Free Software that uses `shared-mime-info` to identify files (any of your GNOMEs, KDEs, etc) are unable to correctly identify Zip files by their EOCD due to lack of accepted syntax for defining search patterns based on negative file offsets. Please show your support on this Issue if you would also like to see this resolved: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues... (linking to my own comment, so no this is not brigading)
Anything using `file(1)` does not have this problem: https://github.com/file/file/blob/280e121/magic/Magdir/zip#L...
Re: Peeking Inside Gigantic Zips with Only Kilobytes
#10This is really cool! Could also make a useful standalone command line tool. I think the general pattern - using the range header + prior knowledge of a file format to only download the parts of a file that are relevant - is still really underutilized. One small problem I see is that a server that does not support range requests would just try to send you the entire file in the first request, I think. So maybe doing a…