dify
dify copied to clipboard
一个上传文件的接口都搞不定? 坑
Self Checks
- [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [X] Please do not modify this template :) and fill in all the required fields.
Dify version
1
Cloud or Self Hosted
Cloud
Steps to reproduce
1
✔️ Expected Behavior
1
❌ Actual Behavior
1
I found some similar discussions and issues that might help you resolve the file upload problem:
-
Discussions:
-
Closed Issues:
- Package not found err while uploading files into database (Closed) [3]
- Solution: Ensure the temporary files are not deleted prematurely during the index phase by adjusting the scope of
tempfileinextract_processor.py.
- Solution: Ensure the temporary files are not deleted prematurely during the index phase by adjusting the scope of
- 本地docker部署,数据集创建上传pdf文件失败 (Closed) [4]
- Solution: Adjust the
client_max_body_sizein NGINX to handle larger file uploads.
- Solution: Adjust the
- upload file velocity (Closed) [5]
- Solution: This feature has been addressed in the latest version. Ensure you are using the latest CE images.
- Package not found err while uploading files into database (Closed) [3]
For your specific issue with the file upload interface in Dify version 1 on the cloud, ensure the following:
-
File Size and Quantity Limits:
- Maximum size for a single document upload is 15MB.
- Limit of 100 total documents.
- These limits can be adjusted for local deployments [6].
-
Rate Limit:
- Ensure the rate limit for the Embedding model API key has not been reached [6].
-
API Request Format:
- Ensure your API requests for file uploads are correctly formatted. Here is an example:
curl --location --request POST 'https://api.dify.com/datasets/{dataset_id}/document/create_by_file' \
--header 'Authorization: Bearer {api_key}' \
--form 'data="{\"name\":\"Dify\",\"indexing_technique\":\"high_quality\",\"process_rule\":{\"rules\":{\"pre_processing_rules\":[{\"id\":\"remove_extra_spaces\",\"enabled\":true},{\"id\":\"remove_urls_emails\",\"enabled\":true}],\"segmentation\":{\"separator\":\"###\",\"max_tokens\":500}},\"mode\":\"custom\"}}";type=text/plain' \
--form 'file=@"/path/to/file"'
Ensure the Authorization header contains your API key and the file path is correct [7].
If you need further assistance, please provide more details about the error messages or issues you are encountering.
To continue talking to Dosu, mention @dosu.
Please be friendly and follow our language policy and Code of conduct。 #1542