File Content Access Fails in for file processing Plugins #21

Open
opened 2026-02-15 21:15:19 -05:00 by yindo · 3 comments
Owner

Originally created by @fdb02983rhy on GitHub (Mar 20, 2025).

Description

The File.blob property should make file content directly accessible, but instead attempts HTTP requests even for local files.

@property
def blob(self) -> bytes:
    if self._blob is None:
        response = httpx.get(self.url)  # Raise error for local files
        response.raise_for_status()
        self._blob = response.content
    return self._blob

Fix needed: The SDK should detect local files and read them directly.

Notice

It only happens on local deployment.

Related Github Issue

https://github.com/langgenius/dify/issues/16327

Related Plugin

https://github.com/fdb02983rhy/dify-pdf-process-plugin
https://github.com/Yevanchen/pymupdf-in-dify
Or any other plugins that needs local file access.

Originally created by @fdb02983rhy on GitHub (Mar 20, 2025). ## Description The `File.blob` property should make file content directly accessible, but instead attempts HTTP requests even for local files. ```python @property def blob(self) -> bytes: if self._blob is None: response = httpx.get(self.url) # Raise error for local files response.raise_for_status() self._blob = response.content return self._blob ``` Fix needed: The SDK should detect local files and read them directly. ## Notice It only happens on local deployment. ## Related Github Issue https://github.com/langgenius/dify/issues/16327 ## Related Plugin https://github.com/fdb02983rhy/dify-pdf-process-plugin https://github.com/Yevanchen/pymupdf-in-dify Or any other plugins that needs local file access.
Author
Owner

@Gevtolev commented on GitHub (Mar 26, 2025):

https://github.com/langgenius/dify/issues/16327#issuecomment-2753681038

@Gevtolev commented on GitHub (Mar 26, 2025): https://github.com/langgenius/dify/issues/16327#issuecomment-2753681038
Author
Owner

@Gevtolev commented on GitHub (Mar 26, 2025):

We'll consider modifying the code later.

@Gevtolev commented on GitHub (Mar 26, 2025): We'll consider modifying the code later.
Author
Owner

@camucamulemon7 commented on GitHub (Jun 16, 2025):

Has this issue been resolved?

@camucamulemon7 commented on GitHub (Jun 16, 2025): Has this issue been resolved?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-sdks#21