Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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);
Comment

PREVIOUS NEXT
Code Example
Php :: get all errors view laravel 
Php :: php date month italian 
Php :: php base64 encoded image to png 
Php :: if button is clicked php 
Php :: laravel delete records of child relations 
Php :: php make array to certain length 
Php :: fixuphost 
Php :: php add to array if not exists 
Php :: smarty if 
Php :: how to get video duration in php 
Php :: php remove all parameter from url 
Php :: mysql server has gone away php 
Php :: laravel collection remove duplicates 
Php :: codeigniter query builder order by 
Php :: run laravel mix 
Php :: php call protected function from child class 
Php :: upppercase php 
Php :: php date to seconds 
Php :: Get date without time in laravel 
Php :: how to install dompdf in laravel 
Php :: laravel display old value in form 
Php :: basic code for file upload in php 
Php :: wordpress get child posts 
Php :: deleteall in cakephp 
Php :: php usort keep keys 
Php :: replace all numbers in string php 
Php :: remove first element in array php 
Php :: string into integer php 
Php :: php carbon from timestamp 
Php :: install mess detector 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =