firstly - thank you for taking a look at my question.
Given the code below (which works perfectly for me). I was wondering how to do 2 things.
1 - make it so that it is a file browse rather than a hard coded file name and location.
2 - an alternate version where instead of a file - if I had a variable (for example var X = "123,4,6,7\r\n124,6,7,8") but wanted to post it as if it was a file? ie set the file name etc etc.
is it possible someone could help me with that?
$filePath = 'C:\xampp\htdocs\demo\XXXXX.csv';
// 3rd parameter is filename with extension
$cfile = new CURLFile($filePath, 'text/csv', 'XXXXX.csv');
$postFields = [
'file' => $cfile,
'name' => $nameofcampaign,
'template' => $template