Pull requests / #724
#724 Add local PDF, Word and Excel attachments with screenshot previews
closed · @medking82 · 0 comentarios · En GitHub
Setup & installServer & APISecurityWindowsLinux
Descripción
The web chat currently accepts text files and sends images, but screenshots have no preview or persisted draft and PDF, Word and Excel files cannot be read. This adds screenshot paste/drop previews and bounded, local document extraction to the existing single-chat UI. ## Behavior - PDF, DOCX, XLSX and text/source files are attached as extracted text. Scanned PDF pages can fall back to PNG images when the model supports vision. - Images retain the existing native OpenAI `image_url` format. Drafts survive reload when browser storage permits; a storage failure explicitly warns that the current draft is only in memory. - Document batches extract serially. Send waits for queued files, removal updates the draft, and New chat cancels old extraction work so stale files cannot enter the next chat. - The same-origin, authenticated `/v1/files/extract` route checks declared request size before reading uploads. A separate worker reuses the existing process-lifetime containment, with a 30-second timeout, 768 MiB memory limit and two-worker admission cap. Uploaded originals are not written to disk. ## Limits 20 MiB per file, 512 KiB extracted text, at most eight rendered PDF pages with a 1600-pixel edge and an 8 MiB image payload cap. DOCX extraction covers body paragraphs and tables; embedded images are not extracted. XLSX reads cached values and does not execute formulas. Complex files may hit these bounds. This uses pinned parser dependencies and leaves installed engine/runtime dependencies alone. ## Validation - Windows: 32 extraction, HTTP-admission and setup dependency tests passed. - Windows: 149 existing server, security, lifecycle and process-containment regression tests passed. - 12 Node attachment tests passed, including serial batches, cancellation, pending Send, draft reload and storage-quota failure/recovery. - JavaScript syntax and scoped whitespace checks passed. - Isolated synthetic browser fixture: screenshot plus PDF/DOCX/XLSX batch, disabled Send during extraction, persisted previews after reload, removal and captured native image/text request passed. Desktop and 390-pixel layout checked. This is independent of chat persistence, compaction and adaptive memory policy. It does not alter the native engine or require a running model for document extraction. Linux worker limits are implemented but have not been exercised in this contribution's Windows validation.
En el sitio
Enlaces a install, modelos, releases.