I have no idea what that response from Curl means.
Note that form submissions into ODK Aggregate use standard plain old form
posts. If you have a working ODK Aggregate, you can see the web page for
form submission by opening a browser and pointing to .../formUpload. You
can then view source on that page and reconstruct what you should be
sending to the server.
i.e., if you had the ability to log into opendatakit.appspot.com, you could
get to this plain old web page via:
http://opendatakit.appspot.com/formUpload
From there, your knowledge of Curl should enable you to construct the
appropriate submission.
Mitch
···
On Tue, Mar 12, 2013 at 9:14 AM, wrote:Hi there,
I am working on a PHP application to manage forms and form data from
outside ODK.
My idea was to post the form definition file from within the application
using curl.
Something like:$ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)"); curl_setopt($ch, CURLOPT_URL, '
http://myAggregateserver.org/ODKAggregate/formUpload');
curl_setopt($ch, CURLOPT_USERPWD, "myUser:myPassword");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_POST, true);
$post = array(
"form_def_file"=>"@myformdefinition.xml",
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);This does not work however.
The application returns: "Resource id #2"Is there anyone who has an idea how to do this?
Cheers!
Wiebe
--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com