[PR #2677] [CLOSED] serve: PDF, Word, Excel and PowerPoint files in the chat page's attach button (POST /convert, MarkItDown, optional) #4208

Closed
opened 2026-11-07 15:34:01 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2677
Author: @page1
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: feature/convert-attachments


📝 Commits (1)

  • 84cd55a serve: PDF, Word, Excel and PowerPoint files in the chat page's attach button (POST /convert, MarkItDown, optional)

📊 Changes

5 files changed (+169 additions, -2 deletions)

View changed files

📝 docs/DETAILS.md (+14 -0)
📝 serve/server.py (+60 -0)
📝 serve/test_server.py (+61 -0)
📝 serve/web/app.js (+33 -1)
📝 serve/web/index.html (+1 -1)

📄 Description

Title

Issue: Resolves #2676

Summary

The chat page's attach button (or a drop) also takes .pdf, .docx, .xlsx and .pptx. The server turns each into Markdown with MarkItDown, and the page attaches it like a text file. MarkItDown is optional and not installed by setup: without it nothing changes, and the button says how to install it.

What changed

  • serve/server.py: convert_document() and POST /convert ({"name", "data": base64} -> {"text"}). It answers only Strata's own page, like /settings, and reads only what it is sent. Limits: 50 MB per file, 1 MB of text. Errors: 400 for another file type or bad data, 501 when MarkItDown is missing (with the pip command for the running Python), 422 for a damaged or protected file.
  • serve/web/app.js, index.html: the attach button accepts the four types and sends them to /convert.
  • docs/DETAILS.md: a short section, with the install line for Windows and Linux. No OCR: a scanned PDF is refused with "No text found".
  • serve/test_server.py: ConvertDocuments (other types refused, own page only, a PDF, a damaged file); the two that need MarkItDown skip without it.

Extra Notes

Tests: all 43 serve/test_*.py suites pass without MarkItDown; the 4 ConvertDocuments tests pass with markitdown 0.1.8 (Windows 11, Python 3.13), where a 342 KB PDF became 26K characters in 0.9 s. Not tested on Linux.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2677 **Author:** [@page1](https://github.com/page1) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/convert-attachments` --- ### 📝 Commits (1) - [`84cd55a`](https://github.com/Niko1221/Strata/commit/84cd55ae41407a4c10c3ebc406f93fea21e027ce) serve: PDF, Word, Excel and PowerPoint files in the chat page's attach button (POST /convert, MarkItDown, optional) ### 📊 Changes **5 files changed** (+169 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+14 -0) 📝 `serve/server.py` (+60 -0) 📝 `serve/test_server.py` (+61 -0) 📝 `serve/web/app.js` (+33 -1) 📝 `serve/web/index.html` (+1 -1) </details> ### 📄 Description ## Title Issue: Resolves #2676 ## Summary The chat page's attach button (or a drop) also takes .pdf, .docx, .xlsx and .pptx. The server turns each into Markdown with MarkItDown, and the page attaches it like a text file. MarkItDown is optional and not installed by setup: without it nothing changes, and the button says how to install it. ## What changed - `serve/server.py`: `convert_document()` and `POST /convert` (`{"name", "data": base64}` -> `{"text"}`). It answers only Strata's own page, like `/settings`, and reads only what it is sent. Limits: 50 MB per file, 1 MB of text. Errors: 400 for another file type or bad data, 501 when MarkItDown is missing (with the pip command for the running Python), 422 for a damaged or protected file. - `serve/web/app.js`, `index.html`: the attach button accepts the four types and sends them to `/convert`. - `docs/DETAILS.md`: a short section, with the install line for Windows and Linux. No OCR: a scanned PDF is refused with "No text found". - `serve/test_server.py`: `ConvertDocuments` (other types refused, own page only, a PDF, a damaged file); the two that need MarkItDown skip without it. ## Extra Notes Tests: all 43 `serve/test_*.py` suites pass without MarkItDown; the 4 `ConvertDocuments` tests pass with markitdown 0.1.8 (Windows 11, Python 3.13), where a 342 KB PDF became 26K characters in 0.9 s. Not tested on Linux. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:34:01 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4208
No description provided.