I was wondering is there any way by which I can download only a part of a .rar or .zip file without downloading the whole file ? There is a zip file containing files A,B,C and D. I only need A. Can I somehow, tweak the download to download only A or if possible extract the file in the server itself and get A only ?
相关问题
- NIO2: how to generically map a URI to a Path?
- How to transfer the shared prefs from Instant app
- PHP Fatal error: Uncaught Error: Class 'ZipArc
- Run `head` on a text file inside a zipped archive
- How to parse a zipped file completely from RAM?
相关文章
- Merge multiple zip files into a single zip file in
- How to extract zip file using dotnet framework 4.0
- Add files to ZIP without paths, using SharpZipLib
- Upload a ZIP file and UNZIP ftp folder via PHP
- How do I save each sheet in an Excel 2010 workbook
- php zlib: How to dynamically create an in-memory z
- Unzip into TreeMap in Java
- Overwrite contents of ZipArchiveEntry
In a way, yes, you can.
ZIP file format says that there's a "central directory". Basically, this is a table that stores what files are in the archive and what offsets do they have.
So, using Content-Range you could download part of file from the end (central directory is the last thing in zip file) and try to identify central directory in it. If you succeed then you know file list and offsets, so you can proceed and get those chunks separately and decompress them yourself.
This approach is quite error-prone and is not guaranteed to work. But so is hacking in general :-)
Another possible approach would be to build a custom server for that (see @pst's answer for more details).