I know I can use this syntaxt to send a file using php, post and curl.
$post = array(
\"file_box\"=>\"@/path/to/myfile.jpg\",
);
curl_setopt($ch, CURL
You can create a file using tempnam in your temp directory:
$string = 'random string';
//Save string into temp file
$file = tempnam(sys_get_temp_dir(), 'POST');
file_put_contents($file, $string);
//Post file
$post = array(
"file_box"=>'@'.$file,
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
//do your cURL work here...
//Remove the file
unlink($file);