langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
53.7k stars 7.86k forks source link

Unexpect File Object #9948

Closed Jalen-Zhong closed 4 weeks ago

Jalen-Zhong commented 1 month ago

Self Checks

Dify version

0.10.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I use HTTP node to upload a file by posting my api. I find the "file object" is unexpected by print "file". The file is upload by local file.

✔️ Expected Behavior

”filename“ fields should be real file name. But the result display "upload".

❌ Actual Behavior

No response

dosubot[bot] commented 1 month ago

@Jalen-Zhong Hello! I'm here to help you with your bug report. I can assist you in solving bugs, answering questions, and becoming a contributor.

The issue you're encountering, where the filename defaults to "upload" instead of the expected filename, is likely due to how Dify handles file uploads in the HTTP node. Dify attempts to extract the filename from the URL using path.basename(url). If the URL does not contain a valid filename, or if the extraction process fails, the filename might default to "upload" [1].

To resolve this, ensure that the URL or the HTTP request setup in Dify includes a valid filename. Additionally, check if the content-disposition header is correctly set in your request, as it can influence the filename determination. If the header is missing or incorrectly formatted, it might lead to the default "upload" filename being used.

To continue talking to Dosu, mention @dosu.

crazywoola commented 4 weeks ago

This should be fixed in v0.11.0