Skip to content

fix(ui): allow .txt upload in Web UI#374

Merged
rstrahan merged 2 commits into
aws-solutions-library-samples:developfrom
gargisingh1993:fix/allow-txt-upload
Jun 23, 2026
Merged

fix(ui): allow .txt upload in Web UI#374
rstrahan merged 2 commits into
aws-solutions-library-samples:developfrom
gargisingh1993:fix/allow-txt-upload

Conversation

@gargisingh1993

Copy link
Copy Markdown

Summary

Adds .txt (plain text) to the Web UI upload allow-list to align the UI with existing backend support.

Closes #373.

Why

The backend OCR service already processes .txt (_process_non_pdf_document()DocumentConverter.convert_text_to_pages()), but the UI file picker blocked it because .txt was missing from SUPPORTED_UPLOAD_EXTENSIONS. Users with plain-text corpora had to bypass the UI by uploading directly to S3.

Changes

  • src/ui/src/components/common/constants.ts
    • Added .txt to SUPPORTED_UPLOAD_EXTENSIONS
    • Updated SUPPORTED_UPLOAD_FORMATS_LABEL to mention plain text

Not changed

  • SUPPORTED_DISCOVERY_EXTENSIONS — Discovery remains intentionally PDF/image-only
  • No backend changes — the .txt processing path already exists and is in use

Testing

  • npm run typecheck and eslint pass; full UI test suite (vitest) passes.
  • Built the UI with the change and deployed to a live v0.5.9 stack (WebUI bundle + CloudFront invalidation). Confirmed .txt files upload through the UI and process end-to-end (classification → extraction → assessment → summarization → KB indexing). No backend changes were needed.

Add .txt to SUPPORTED_UPLOAD_EXTENSIONS and update the format label so
plain-text files can be selected in the Web UI. The backend OCR service
already supports .txt via DocumentConverter.convert_text_to_pages(); this
aligns the UI allow-list with existing backend capability. No backend
changes required.

Closes aws-solutions-library-samples#373
@gargisingh1993 gargisingh1993 changed the base branch from main to develop June 22, 2026 22:53
Addresses review feedback on aws-solutions-library-samples#374:
- Add CHANGELOG.md entry under Unreleased/Fixed for the .txt upload fix (aws-solutions-library-samples#373)
- Update upload FormField constraintText to reflect spreadsheet/Word/text
  backend conversion (previously only mentioned Excel)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rstrahan rstrahan merged commit fa54443 into aws-solutions-library-samples:develop Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.txt files blocked by Web UI upload despite full backend support

2 participants