cURL

6 minutes read
How to upload a file from one server to another server using PHP cURL POST method. How to send files using PHP and cURL The cURL functions in PHP can be used to make HTTP requests to remote servers. The curl_setopt  method allows us a wide range of options to be set, but no one of them directly related to send files. But we can send files using cURL with special format for POST parameter values. Following script is usefull in sending a binary file via cURL. This code will make a request to http...
4 minutes read
cURL is a best library for file transfer via different types of protocols. cURL supports the transport via POST, GET, FTP upload and much more. cURL is also able to authenticate on the destination server or website. How to send files using PHP and cURL In this tutorial we want to upload a file to other (password protected) remote FTP server using a web form. <?php if (isset($_POST['Submit'])) { if (!empty($_FILES['file']['name'])) { $ch = curl...