Answers for "upload files using "GET" METHOD CURL"

1

php upload file via curl

if (function_exists('curl_file_create')) { // php 5.5+
  $cFile = curl_file_create($file_name_with_full_path);
} else { // 
  $cFile = '@' . realpath($file_name_with_full_path);
}
$post = array('extra_info' => '123456','file_contents'=> $cFile);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$target_url);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$result=curl_exec ($ch);
curl_close ($ch);
Posted by: Guest on August-13-2020
1

curl download file without output

curl -O https://www.cyberciti.biz/files/sticker/sticker_book.pdf
Posted by: Guest on June-26-2020

Code answers related to "upload files using "GET" METHOD CURL"

Browse Popular Code Answers by Language