I am using phone gap api+php to make apps dynamically. I am using php's curl library for this. The code is as follows:
$ch = curl_init();
$localFile = '@www_events/apps/abhi.zip';
$target_url = "https://build.phonegap.com/api/v1/app...;
curl_setopt($ch, CURLOPT_PUT, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('file'=>$localFile));
curl_setopt($ch, CURLOPT_URL, $target_url);
$result = curl_exec($ch);
From the above code, I am not able to update the new code. Its only rebuild the old code. How can i upload the latest code using file based create method
Please help me in this issue.
Help get this topic noticed by sharing it on Twitter, Facebook, or email.
Once you pack the app, it become read-only. It is not possible to make it dynamically update.
Note: PhoneGap doesn't provide you with embedded webserver so any kind of server-side script like php, aspx, py will be ignored. To access device filesystem, events, or to communicate to external resource, use PhoneGap Core API (http://docs.phonegap.com).
Thanks for the reply. I know that all types server scripting will be ignored but that script is only used to send a zip file to phonegap server. Actually I need to update the code using phonegap API, Is this possible with API? If yes, I need to know how can i send zip file to phonegap server? As You can see in the above script I used PUT method and sending a zip file but the script did not send zip file to server and only rebuild the app with old code.
Please help me