Using cURL to upload a file without @ symbol? Using cURL to upload a file without @ symbol? curl curl

Using cURL to upload a file without @ symbol?


In case anyone is viewing this in 2019 and beyond after finding this result on Google (as I have) the issue has been resolved as per this bug fix.

You can now use CURLFile to send files via PHP CURL requests as below:

$fullpath = '/var/www/html/website/test.png';$mime = 'image/png';$publicname = 'testpic';$cfile = curl_file_create($fullpath,$mime,$publicname);$fields[$publicname] = curl_file_create($fullpath,$mime,$publicname);

Which would be then used in e.g.

curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);

Further information can be found here.


What I ended up doing is detecting if any of the input data started with an @ symbol and if they did, then submitting them as a GET variable (as part of the submit URL in cURL). It does not help with all cases (such as when a large string is submitted that starts with an @), but cuts out the problems I had with Twitter handles.