Replies: 3 comments 1 reply
-
try to using file donwload api |
Beta Was this translation helpful? Give feedback.
1 reply
-
Does anyone meet the same problem? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Actually the 'dify_plugin.file.File.blob' download file from remote after you have set FILES_URL/INTERNAL_FILES_URL in .env file. Remember expose the 5001 port in docker-compse.yaml if in plugin debugging mode. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
Version
dify 1.2.0
Cloud or Self Hosted
Self Hosted, Ubuntu system
Description of the problem
I need to extract the content of a file uploaded at the Start node. Since the file is not a typical doc type file, I have to write a customer plugin to process it. However, I met problems when try to obtain the content of the uploaded file in Plugin daemon. The "file" being transferred into the plugin is actually a "dify_plugin.file.File" object, it doesn't contain the real content of the file, instead, it contains the description and some "properties" of the file, such as filename, extension, size, url, etc. I noticed I could get the content of the file using the "blob" function of class File, but when I used it, it reported the following error:
"Run failed: url should start with http:// or https://"
Since in blob function, it uses "httpx" to extract the content from file url, that's why it requires url start with http:// or https://. However, I checked the "url" of my file object, it started with "/file/****". I think this is because I host the dify in my own computer, while dify doesn't produce the correct url start with http.
I don't know if this is a bug or something? It seems using blob function with correct url as input is the only way to get the content of uploaded file. Do anyone know other method to get the content of the file?
2. Additional context or comments
No response
Beta Was this translation helpful? Give feedback.
All reactions