Skip to main content

how to remote download a file using multi-part downloading?



i want to download a remote file on internet to my host. but i want to download it with multi-part downloading to make it download faster. just the same as download managers .




Comments

  1. You have to use Range header while requesting.

    Sending Range: bytes=500-999 will download the bytes form 500 to 999;

    Note: PHP is not a multi-threaded language. So even you download by multi-part it'll be sequential. Unless you fork multiple process. Though using third-party extensions like curl you can do this through curl_multi_exec

    ReplyDelete
  2. This will be dependent on the server that you are downloading from supporting Range Requests. Read up on Range Requests, and combine this with a multi-threaded cURL, and you'll be able to have more than one download stream working at a time.

    ReplyDelete

Post a Comment