I found cURL and want to use it to upload a file after a form has been submitted. I found the following code on http://php.net/curl
<?php /* http://localhost/upload.php: print_r($_POST); print_r($_FILES); */ $ch = curl_init(); $data = array('name' => 'Foo', 'file' => '@/home/user/test.png'); curl_setopt($ch, CURLOPT_URL, 'http://localhost/upload.php'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_exec($ch); ?>
Now I'd just like to know if I would use my usual file upload code on upload.php in order to upload the file or would I need to alter my code to accommodate cURL???