Hi I'm trying to return a value from a API call via the file transfer plugin for cordova. I've shown below my php code for the API which is working fine and the Cordova code. Essentially what I want to do is turn the return statement in the API into a JS variable in Cordova. This is the Php code, the move_uploaded_file part works fine:
protected function uploadPicturesAction()
{
move_uploaded_file($tmp_name, "/home/sean/images/{$name}.jpg");
return $name;
}
This is the cordova part, so here I am trying to get the variable $name to become a JS variable.
fileTransfer.upload(image, encodeURI("sean.co.uk/api.php?action=uploadPictures"), imagePage2(), fail, options);
Any help would be much appreciated.