feat(medic/cht-core#10509): add documentation for contact form attachment uploads#2133
Merged
dianabarsan merged 2 commits intomedic:mainfrom Feb 23, 2026
Conversation
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
cliftonmcintosh
commented
Feb 18, 2026
| </upload> | ||
| ``` | ||
|
|
||
| **Note:** If the contact form is accessed via CHT Android and uses a file picker to upload files, include the `READ_EXTERNAL_STORAGE` permission to allow access to files on the device. Add the following line to the branded app's `AndroidManifest.xml`: |
Contributor
Author
There was a problem hiding this comment.
This note is copied from the report forms documentation. Is this true?
Contributor
Author
|
Would you be willing to review this? Is there someone else I should ask? |
dianabarsan
reviewed
Feb 20, 2026
|
|
||
| ## Uploading Binary Attachments | ||
|
|
||
| _Added in 5.1._ |
Member
There was a problem hiding this comment.
5.1.0 . please use full semver.
Contributor
Author
There was a problem hiding this comment.
Yes! Updated
| </upload> | ||
| ``` | ||
|
|
||
| **Note:** If the contact form is accessed via CHT Android and uses a file picker to upload files, include the `READ_EXTERNAL_STORAGE` permission to allow access to files on the device. Add the following line to the branded app's `AndroidManifest.xml`: |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This adds documentation for contact form attachment uploads. This goes with medic/cht-core#10570.
AI disclosure
Claude Code was used when generating this documentation. I gave Claude directions by showing it report documentation and code and examples in cht-core. I reviewed and edited the changes proposed by Claude.
Here are my directions to Claude
Note that Claude filled in the "Plan and implementation" section.
Contact attachment upload documentation
Goal
I want to add documentation about the ability to upload attachments in contact forms.
Similar documentation for "app" forms
There is some documentation for attachment uploads in
content/en/building/forms/app.md, but it is pretty minimal. I want to include a small example code snippet in our documentation for contacts.Samples
The "photo" element in
~/workspace/cht-core/config/default/forms/contact/person-create.xmlis an example of using an Enketo upload widget to upload an attachment. You don't need to read the full file. It is very large. You can rely in the diff I have printed here.Diff showing the "photo" element
Your job
~/workspace/cht-core/config/default/forms/contact/person-create.xml~/workspace/cht-core/webapp/src/ts/services/contact-save.service.tsfor extra information~/workspace/cht-coreto understand how uploading attachments works.content/en/building/forms/contact.mdwith your proposed changes.Plan and implementation
Sources reviewed
content/en/building/forms/app.md— existing "Uploading Binary Attachments" section (brief; no XLSForm example)config/default/forms/contact/person-create.xmldiff — shows thephotofield using<upload ref="..." mediatype="image/*">and<bind ... type="binary"/>webapp/src/ts/services/contact-save.service.ts— confirms files from Enketo's FileManager are attached with auser-file-prefix; file names are sanitized; binary fields in XML are also processedApproach
Added a new
## Uploading Binary Attachmentssection tocontent/en/building/forms/contact.md, placed just before the existing## Propertiessection (mirroring placement in app.md).The section:
imagefor photos,filefor generic files, orinstance::type: binaryfor any field)photofield inperson-create.xmlREAD_EXTERNAL_STORAGEpermission note (copied from app.md, as it applies equally to contact forms)License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.