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
POST
of 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-Length
header (the maxSize ), it is recommended that the client split thePOST
into multiple individualPOST
requests, each containing the form’s XML submission and one or more additional parts such that each partialPOST
request is no greater than maxSize ; if a single additional part is greater than maxSize , thePOST
should contain the form’s XML submission and that single additional part. Regardless of whether the client observes and honors theX-OpenRosa-Accept-Content-Length
header, a compliant server with give its best effort to accept submissions of any length.
There is not a limit on the number of POST
s 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 POST
s, 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.