Replies: 3 comments 1 reply
-
To upload a file using the API in version 0.11.0, you should 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. Here's a correct example of how to use the curl command for file uploads: curl --location --request POST 'https://api.dify.ai/v1/datasets/{dataset_id}/document/create_by_file' \
--header 'Authorization: Bearer {api_key}' \
--form 'data="{"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"' \
--form 'user="abc-123"' Make sure that the If you continue to encounter issues, double-check the file path and ensure that the file is accessible from the location specified in your curl command. |
Beta Was this translation helpful? Give feedback.
-
curl --location --request POST 'https://api.dify.ai/v1/datasets/98915774-f515-4ae7-9fa5-5a85f7fc58d3/document/create_by_file' \
|
Beta Was this translation helpful? Give feedback.
-
and i want to use workflows |
Beta Was this translation helpful? Give feedback.
-
Self Checks
Provide a description of requested docs changes
when i ues
Beta Was this translation helpful? Give feedback.
All reactions