How to Restart a Failed Curl Transfer in PHP

Curl is a programming language used with PHP to download and manipulate Web pages inside PHP files. If your code is transferring a file with Curl and errors out, you can use a resume option to pick up the transfer where it left off. This is of particularly good use in situations where your connection isn't the best between the two servers or when a server unexpectedly crashes, leaving the transfer cut off in the middle.

Instructions

    • 1

      Open your PHP file.

    • 2

      Type "$curlHandle = curl_init();" without quotes on a new line to setup the initial Curl file handler.

    • 3

      Type "curl_setopt($curlHandle, CURLOPT_URL, $yourTransferUrl);" without quotes onto the next line to start the transfer with the resume option "CURLOPT_URL" enabled.

Related Searches:

Comments

Related Ads

Featured