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, CURLOPT_POSTFIELDS, $post);
How can I take a string, build a temp file and send it using the exact same syntax ?
Update:
I would prefer using tmpfile() or php://memory so I don't have to handle file creation.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…