Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Use compressed data directly - from ZIP files or gzip http response (united-coders.com)
29 points by philf on Oct 17, 2011 | hide | past | favorite | 3 comments


I was hoping for something more like this:

Extracting files from a remote ZIP archive (accessing files stored inside a zip file without downloading the whole zip archive)

http://www.codeproject.com/KB/cs/remotezip.aspx

And would like to see an implementation of a server-side means of generating arbitrary .zip files (just storing, without compression) dynamically... for automatic large download integrity verification. Places like http://put.io could use something like that.


I wrote something similar in JS

https://github.com/gildas-lormeau/zip.js/blob/master/WebCont...

The HttpRangeReader class is able to extract a file from the zip without downloading the whole zip. Thanks to new Blob APIs , extracting data from a zip without compression is quite fast. Then, you just have to use url.createObjectURL to convert the Blob object into a URL.


If you know that the input data is ASCII-encoded (or Unicode-encoded and capable of being ASCII-encoded), then using Python's cStringIO package (http://docs.python.org/library/stringio.html) is preferential for the significant speed boost.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: