I’ve tried testing this too, albeit not as thoroughly as I’d like. It’d be really helpful if someone could get the Android logcat output while these upload problems occur. Check out ODK’s guide for installing adb and obtaining logs.
A preliminary guess is that this is related to connection speed / reliability, as I could reproduce weirdness more frequently while using my phone’s mobile connection than while using WiFi.
KoBoCAT sends an X-OpenRosa-Accept-Content-Length header with value 10000000 to clients, requesting that they split submissions larger than ~10 MB into separate HTTP POST requests. The specification reads:
If a full
POSTof the form’s XML submission and its additional parts (for example, captured image, audio or video clips) would exceed the size specified in theX-OpenRosa-Accept-Content-Lengthheader (the maxSize ), it is recommended that the client split thePOSTinto multiple individualPOSTrequests, each containing the form’s XML submission and one or more additional parts such that each partialPOSTrequest is no greater than maxSize ; if a single additional part is greater than maxSize , thePOSTshould contain the form’s XML submission and that single additional part. Regardless of whether the client observes and honors theX-OpenRosa-Accept-Content-Lengthheader, a compliant server with give its best effort to accept submissions of any length.
There is not a limit on the number of POSTs that a client can send for a single submission, so theoretically submissions—not attachments—of unlimited size can be uploaded. Of course, with a large enough submission, something will eventually break ![]()
Individual POSTs, however, cannot exceed 100 MB on our servers (kc.kobotoolbox.org and kc.humanitarianresponse.info), which effectively sets the ceiling for attachment size. The actual maximum allowable size of an attachment will be somewhat less than 100 MB due to overhead.
It’s worth noting that ODK Collect and Enketo differ as to how they interpret X-OpenRosa-Accept-Content-Length:
- Enketo interprets the value of this header as an upper bound on the size of any individual attachment and refuses to accept anything larger.
- ODK Collect currently ignores the header and “always splits files into 10Mb posts. If a file exceeds 10Mb, it will be sent in its own post with the submission XML.” I know this to be true from having uploaded a single image in excess of 30 MB and even larger videos.
