mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2677] [CLOSED] serve: PDF, Word, Excel and PowerPoint files in the chat page's attach button (POST /convert, MarkItDown, optional) #4208
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4208
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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)
84cd55aserve: 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()andPOST /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_*.pysuites pass without MarkItDown; the 4ConvertDocumentstests 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.