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
There are several ways for a normal person to be able to download an individual file from a compressed ZIP file, unfortunately they aren't common knowledge. There are some open-source tools and online web services, including:
You can use FDM, it's support Zip files partial download: Free Download Manager lets you download only the necessary part of a zip file.
http://www.freedownloadmanager.org/features.htm
Instead, use Google Docs's reader. Goto this link- https://docs.google.com/viewer?url=http://file.zip and change the address of zip file. It can open both zip and rar files
Can you arrange for your file to appear in the back of the zip?
Download 100k:
Check what files we did get:
Then extract the last file:
The trick is to do what Sergio suggests without doing it manually. This is easy if you mount the zip file via an HTTP-backed virtual filesystem then use the standard unzip command on it. This way the unzip utility's I/O calls are translated to HTTP range gets, which means only the chunks of the zip that you want get transferred over the network.
Here's an example for Linux using HTTPFS, a very lightweight virtual filesystem (it uses FUSE). There are similar tools for Windows.
Get/build httpfs:
Mount a remote zip file and extract one file from it:
Of course you can also use whatever other tools beside the command-line one. (I need sudo because it seems FUSE is set up that way on my machine, you shouldn't have to need it)
I'm aware that this is an old question, this is for others running into this problem.
I think Sergei Tulentsevs idea is brilliant.
However, if there is control over the server -- e.g. custom code can be deployed -- then it is a rather trivial operation (in the scheme of things :) to map/handle a request, extract the relevant portion of the ZIP archive, and send the data back in the HTTP stream.
The request might look like:
Which would mean extract -- and return -- "a.jpeg" from "myfile.zip".
(I intentionally chose this silly format so that browsers would likely choose "myfile.zip_a.jpeg" as the name in the download dialog when it appears.)
Of course, how this is implemented depends on the server/language/framework and there may already be existing solutions that support a similar operation (but I know not).
Happy coding.