I'm trying to send my file, but using GET not POST with curl.
I have:
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, "http://localhost/test.php/?file_contents=$file");
$result = curl_exec($ch);
I know that I can easily send the file with a POST curl request like so (taken from this question here):
$data = array(
'uploaded_file' => '@'.$tmpfile.';filename='.$filename,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
However, I don't want my request to be a POST. I can't seem to figure out how to incorporate a file transfer without it.
Any help or recommendations? I thought of using curl_file_create() but I'm not sure how to implement it in this as the documentation for it is rather terrible.