I am trying to find if it is possible to download a part of a file (any file) via axel or aria2 or any other tools available.

For example there is a movie file (because doing this kind of thing make sense in A/V files). How could I download only the last 50MB or the third 60Mb from the first of the file?

The files are on HTTP servers mostly; but could be on FTP servers. If it is possible to download them via other protocols, this would also be an option.


2 Answers 2


Whether or not you can download a portion of a file depends on the protocol being used to transfer the content.

If the files are available over HTTP/1.1, then any server that correctly supports the Range header (see section 14.35 of RFC 2616) should allow you download portions of the file.

Consider the following file:

$ cat testfile.txt

If I serve this up with nginx, a webserver that supports the Range header, I can download portions of it (newlines inserted for readability):

$ curl --header "Range: bytes=2-3" https://localhost/testfile.txt -k
$ curl --header "Range: bytes=0-1" https://localhost/testfile.txt -k
$ curl --header "Range: bytes=4-" https://localhost/testfile.txt -k

This is the same feature that curl, wget, and other HTTP clients use to "resume" interrupted transfers.

The FTP protocol provides resuming a file transfer at a given offset via the RESTART (REST) command (See section 4.1.3 of RFC 959). Using the same testfile.txt as above, served by FTP:

$ touch testfile.txt
$ ftp localhost
Connected to localhost.
220 (vsFTPd 2.2.2)
Name (localhost:steve): anonymous
331 Please specify the password.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> rest 3
restarting at 3. execute get, put or append to initiate transfer
ftp> get testfile.txt
local: testfile.txt remote: testfile.txt
200 PORT command successful. Consider using PASV.
350 Restart position accepted (3).
150 Opening BINARY mode data connection for testfile.txt (6 bytes).
226 Transfer complete.
3 bytes received in 0.00 secs (19.1 kB/s)
ftp> 221 Goodbye.
$ cat testfile.txt

I'm not familiar with many FTP clients so I don't know if any do this, but it would likely be possible to read any subset of bytes by using the REST command and then simply stoping once you have the number of bytes you want.

It appears that aria2 is capable of resuming both HTTP and FTP transfers with the -c flag. This likely uses the features above as it is only supported for HTTP and FTP. However, it does not appear to natively support downloading only the end or middle segment of a file. It could be possible to exploit the --continue flag by creating a dummy file on disk. If this file had N bytes, perhaps aria would start at the N+1 byte of the file.

  • in 2009 I came across a download manager named prozilla and its GUI prozgui that had the ability to do that. basically you told him to slice the file in to parts of ?mb or ?kb and then ordered it to download the Nth part. but since then that handy tool vanished without a trace.
    – r004
    Mar 25, 2014 at 8:45

curl has --range/-r switch, which is documented to support both HTTP and FTP (and even SFTP) protocols:

curl --range start-end ftp://example.com/file.ext --output test.ext

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.