Is it possible to partially download a remote file with cURL?
Let’s say, the actual filesize of the remote file is 1000 KB.
How can I download only first 500 KB of it?
Is it possible to partially download a remote file with cURL? Let’s say, the
Share
You can also set the range header parameter with the php-curl extension.
But as noted before if the server doesn’t honor this header but sends the whole file curl will download all of it. E.g. http://www.php.net ignores the header. But you can (in addition) set a write function callback and abort the request when more data is received, e.g.