Closed Vampxgg closed 3 days ago
I found some similar discussions and issues related to file uploads in Dify:
How can I upload with multiple files to another server to handle? - This discussion is unsolved and might provide some insights into handling multiple file uploads [1].
I can't upload the image on dify workflow via api - Another unsolved discussion that might be relevant to your issue [2].
The document upload behavior of web and API is inconsistent! - This closed issue suggests ensuring consistent document upload behavior by sharing the same storage volume between API and worker services in the docker-compose.yaml
file [3].
For uploading multiple files using the API without encountering errors, you can use a function like uploadMultipleFiles
to handle batch uploads. This involves preparing and validating files, then uploading them in batches to avoid errors. Make sure to handle potential errors such as FileTooLargeError
, NoFileUploadedError
, TooManyFilesError
, and UnsupportedFileTypeError
[4][5][6].
If you're encountering issues with single file uploads, ensure that the file is correctly included in the form data of your request. The error message "file is required in input form" with status 400 indicates that the file was not properly included. Make sure the request is formatted as multipart/form-data
and that the file type is supported [7].
To continue talking to Dosu, mention @dosu.
You can not even choose a right template. If you choose files, then it should be an array. If this is an single file type, it should not.
Self Checks
Dify version
0.11.2
Cloud or Self Hosted
Cloud
Steps to reproduce
✔️ Expected Behavior
1
❌ Actual Behavior
1