[PR #4398] [MERGED] Fetch, Parse, and Create Documents for Statically Hosted Files #4611

Closed
opened 2026-02-22 18:36:11 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4398
Author: @angelplusultra
Created: 9/17/2025
Status: Merged
Merged: 10/1/2025
Merged by: @timothycarambat

Base: masterHead: 2110-download-file-as-document


📝 Commits (10+)

  • e658700 Add capability to web scraping feature for document creation to download and parse statically hosted files
  • de1793a lint
  • d4a656f Remove unneeded comment
  • 4acb31d Simplified process by using key of ACCEPTED_MIMES to validate the response content type, as a result unlocked all supported files
  • 3c61e40 Add TODO comments for future implementation of asDoc.js to handle standard MS Word files in constants.js
  • f882796 Return captureAs argument to be exposed by scrapeGenericUrl and passed into getPageContent | Return explicit argument of captureAs into scrapeGenericUrl in processLink fn
  • d033ad4 Return debug log for scrapeGenericUrl
  • 2945c26 Change conditional to a guard clause.
  • 44f45b4 Add error handling, validation, and JSDOC to getContentType helper fn
  • c4d67ac remove unneeded comments

📊 Changes

8 files changed (+230 additions, -14 deletions)

View changed files

📝 collector/processLink/convert/generic.js (+86 -9)
collector/processLink/helpers/index.js (+72 -0)
📝 collector/processLink/index.js (+2 -2)
📝 collector/processSingleFile/index.js (+1 -0)
📝 collector/utils/constants.js (+11 -0)
collector/utils/downloadURIToFile/index.js (+48 -0)
📝 collector/utils/runtimeSettings/index.js (+4 -0)
📝 collector/utils/url/index.js (+6 -3)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #2110

What is in this change?

This PR introduces an enhancement to the document upload modal: the web scraping input field can now fetch, parse, and convert statically hosted files (e.g., https://example.com/a-file.pdf) and API endpoints returning JSON (e.g., https://jsonplaceholder.typicode.com/posts) into application documents.

Currently Supporting:

Currently Supporting:

  • Text

    • Plain text: .txt, .md, .org, .adoc, .rst
    • HTML: .html
    • CSV: .csv
    • JSON: .json
  • Documents

    • Word (DOCX): .docx (NOTE: .doc files are currently not supported, only .docx)
    • OpenDocument Text: .odt
    • PDF: .pdf
    • EPUB: .epub
  • Presentations

    • PowerPoint (PPTX): .pptx
    • OpenDocument Presentation: .odp
  • Spreadsheets

    • Excel (XLSX): .xlsx
  • Email

    • MBOX: .mbox
  • Audio

    • WAV: .wav
    • MP3: .mp3
  • Video

    • MP4: .mp4
    • MPEG: .mpeg
  • Images

    • PNG: .png
    • JPEG/JPG: .jpg

Additional Information

The core functionality hinges on the Content-Type header of the response. If the mimetype is supported, your file will be pulled and processed.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 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/Mintplex-Labs/anything-llm/pull/4398 **Author:** [@angelplusultra](https://github.com/angelplusultra) **Created:** 9/17/2025 **Status:** ✅ Merged **Merged:** 10/1/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `2110-download-file-as-document` --- ### 📝 Commits (10+) - [`e658700`](https://github.com/Mintplex-Labs/anything-llm/commit/e65870039d825d17dd06fdf7e94d9ee29880723d) Add capability to web scraping feature for document creation to download and parse statically hosted files - [`de1793a`](https://github.com/Mintplex-Labs/anything-llm/commit/de1793a64706dd00683a9f4b10922cb92a2efc53) lint - [`d4a656f`](https://github.com/Mintplex-Labs/anything-llm/commit/d4a656f00aa246750c031480b744e9bf4a6b8d27) Remove unneeded comment - [`4acb31d`](https://github.com/Mintplex-Labs/anything-llm/commit/4acb31d7c2e9f0812c2434ab528f49fefcd8f1f3) Simplified process by using key of ACCEPTED_MIMES to validate the response content type, as a result unlocked all supported files - [`3c61e40`](https://github.com/Mintplex-Labs/anything-llm/commit/3c61e400d0f579b543246903baef532d0e0d5d57) Add TODO comments for future implementation of asDoc.js to handle standard MS Word files in constants.js - [`f882796`](https://github.com/Mintplex-Labs/anything-llm/commit/f882796a157a9290e0bbb5d163dbd661664a92a6) Return captureAs argument to be exposed by scrapeGenericUrl and passed into getPageContent | Return explicit argument of captureAs into scrapeGenericUrl in processLink fn - [`d033ad4`](https://github.com/Mintplex-Labs/anything-llm/commit/d033ad4953ba199767f1b25180223290ce2afdf2) Return debug log for scrapeGenericUrl - [`2945c26`](https://github.com/Mintplex-Labs/anything-llm/commit/2945c263ecf3edddbb9f13df8a764d6c1d19122a) Change conditional to a guard clause. - [`44f45b4`](https://github.com/Mintplex-Labs/anything-llm/commit/44f45b47f29668e8f7920595330411345be5c686) Add error handling, validation, and JSDOC to getContentType helper fn - [`c4d67ac`](https://github.com/Mintplex-Labs/anything-llm/commit/c4d67ac1864a094258fc303304577a49c798bd96) remove unneeded comments ### 📊 Changes **8 files changed** (+230 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `collector/processLink/convert/generic.js` (+86 -9) ➕ `collector/processLink/helpers/index.js` (+72 -0) 📝 `collector/processLink/index.js` (+2 -2) 📝 `collector/processSingleFile/index.js` (+1 -0) 📝 `collector/utils/constants.js` (+11 -0) ➕ `collector/utils/downloadURIToFile/index.js` (+48 -0) 📝 `collector/utils/runtimeSettings/index.js` (+4 -0) 📝 `collector/utils/url/index.js` (+6 -3) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #2110 ### What is in this change? This PR introduces an enhancement to the document upload modal: the web scraping input field can now fetch, parse, and convert statically hosted files (e.g., https://example.com/a-file.pdf) and API endpoints returning JSON (e.g., https://jsonplaceholder.typicode.com/posts) into application documents. Currently Supporting: ### Currently Supporting: - **Text** - Plain text: `.txt`, `.md`, `.org`, `.adoc`, `.rst` - HTML: `.html` - CSV: `.csv` - JSON: `.json` - **Documents** - Word (DOCX): `.docx` (NOTE: `.doc` files are currently **not** supported, only `.docx`) - OpenDocument Text: `.odt` - PDF: `.pdf` - EPUB: `.epub` - **Presentations** - PowerPoint (PPTX): `.pptx` - OpenDocument Presentation: `.odp` - **Spreadsheets** - Excel (XLSX): `.xlsx` - **Email** - MBOX: `.mbox` - **Audio** - WAV: `.wav` - MP3: `.mp3` - **Video** - MP4: `.mp4` - MPEG: `.mpeg` - **Images** - PNG: `.png` - JPEG/JPG: `.jpg` ### Additional Information The core functionality hinges on the Content-Type header of the response. If the mimetype is supported, your file will be pulled and processed. ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [ ] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:11 -05:00
yindo closed this issue 2026-02-22 18:36:11 -05:00
yindo changed title from [PR #4398] Fetch, Parse, and Create Documents for Statically Hosted Files to [PR #4398] [MERGED] Fetch, Parse, and Create Documents for Statically Hosted Files 2026-06-05 15:19:27 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4611