I need to upload 3 files along with variables in post data. This is what my call looks like -
$data['type1'] = new CurlFile($file1);
$data['type2'] = new CurlFile($file2);
$data['type3'] = new CurlFile($file3);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data, "var1: $val1", "var2: $val2");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data', "headkey: $headkeyValue"));
I am not able to get $app->request()->post('var1'); from slim framework. It is empty.
- I am able to get the
headkeyfrom the Header as$app->request()->headers('headkey'); - I am able to get the data in $_FILES