Curl : Submission to Aggregate

Greetings.

Currently working on a project using ODK aggregate.
As I know it's possible to submit form data to Aggregate server.
To figure out how to do that, my starting point is
javarosa/FormSubmissionAPI : https://bitbucket.org/javarosa/javarosa/wiki/FormSubmissionAPI
javarosa/OpenRosaAPI : https://bitbucket.org/javarosa/javarosa/wiki/OpenRosaAPI
read those and all related wiki pages, still can figure out how to use curl to do that.

After another week web search, I figured out how to submit xml form text data to Aggregate by "curl -F"
Then, I think it will be not so difficult for me to submit associated file such as jpg image file to Aggregate. But it is not.

For example image file = image.jpg
Did try:
curl -F "image=@image.jpg" "[AggregateServerURL]/submission" -> not working.
curl -F "media=@image.jpg" "[AggregateServerURL]/submission" -> not working.
curl -F "binary=@image.jpg" "[AggregateServerURL]/submission" -> not working.

Any help will be appreciated.
Cheers,
Janus

Please, read the specification more carefully:
https://bitbucket.org/javarosa/javarosa/wiki/FormSubmissionAPI

OpenRosa submissions are POSTed to servers as a multipart MIME Envelope *with
at least 1 part (the xml content of the form itself). *Each of these parts
should adhere to the following requirements

Mime Envelope:

  • Content Type: multipart/form-data
  • Contains Exactly 1 XForm Part
  • Contains 0 or More Additional Parts

XForm Part:

  • Content Type: text/xml
  • Name: xml_submission_file

Additional Parts

  • Content Type: arbitrary
  • Name: matches an appropriate element inside of the XForm Element's XML.
··· -

i.e., you MUST send the submission XML with every request. You cannot just
post an image up to the server.

And, to clarify, for the additional (media) parts, the Name is the text
string (filename) that appears within the submission XML for one of the
media fields.

On Wed, Nov 25, 2015 at 7:44 PM, janusma.caben@gmail.com wrote:

Greetings.

Currently working on a project using ODK aggregate.
As I know it's possible to submit form data to Aggregate server.
To figure out how to do that, my starting point is
javarosa/FormSubmissionAPI :
https://bitbucket.org/javarosa/javarosa/wiki/FormSubmissionAPI
javarosa/OpenRosaAPI :
https://bitbucket.org/javarosa/javarosa/wiki/OpenRosaAPI
read those and all related wiki pages, still can figure out how to use
curl to do that.

After another week web search, I figured out how to submit xml form text
data to Aggregate by "curl -F"
Then, I think it will be not so difficult for me to submit associated file
such as jpg image file to Aggregate. But it is not.

For example image file = image.jpg
Did try:
curl -F "image=@image.jpg" "[AggregateServerURL]/submission" -> not
working.
curl -F "media=@image.jpg" "[AggregateServerURL]/submission" -> not
working.
curl -F "binary=@image.jpg" "[AggregateServerURL]/submission" -> not
working.

Any help will be appreciated.
Cheers,
Janus

--
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/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Anyone who can help me? I have managed to install my enketo server express
to a point where all i need is to map it to my server so we can start
working offline, i have found the api key after a long strgle, but facing a
problem as shown in the picture below.. how to get around this would be so
much appreciated.

Might be a good idea to ask the Enketo folks at
https://accounts.enketo.org/support/ or file an issue at
https://github.com/kobotoolbox/enketo-express/issues

Yaw

··· -- Need ODK consultants? Nafundi provides form design, server setup, in-field training, and software development for ODK. Go to https://nafundi.com to get started.

On Fri, Jan 22, 2016 at 10:33 AM, ODK_Enketo User elvina.zirima@gmail.com wrote:

Anyone who can help me? I have managed to install my enketo server express
to a point where all i need is to map it to my server so we can start
working offline, i have found the api key after a long strgle, but facing a
problem as shown in the picture below.. how to get around this would be so
much appreciated.

--
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/d/optout.

Thank you Yaw,I will try this. Appreciate the links.

-----Message d'origine-----

··· De : "Yaw Anokwa" Envoyé : ‎28.‎01.‎2016 07:03 À : "ODK Developers" Objet : Re: [ODK Developers] Re: curl : Submission to Aggregate

Might be a good idea to ask the Enketo folks at
https://accounts.enketo.org/support/ or file an issue at
https://github.com/kobotoolbox/enketo-express/issues

Yaw

Need ODK consultants? Nafundi provides form design, server setup,
in-field training, and software development for ODK. Go to
https://nafundi.com to get started.

On Fri, Jan 22, 2016 at 10:33 AM, ODK_Enketo User elvina.zirima@gmail.com wrote:

Anyone who can help me? I have managed to install my enketo server express
to a point where all i need is to map it to my server so we can start
working offline, i have found the api key after a long strgle, but facing a
problem as shown in the picture below.. how to get around this would be so
much appreciated.

--
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/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "ODK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/opendatakit-developers/-B40syeoZpg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.