invalid_param:Invalid file url #6798

Closed
opened 2026-02-21 18:17:21 -05:00 by yindo · 6 comments
Owner

Originally created by @guxiyang on GitHub (Nov 16, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.11.1

Cloud or Self Hosted

Cloud

Steps to reproduce

Hello, may I ask? I created a workflow in chatflow and initially defined a session variable (documentFiles) of type file list. When I called it through the API interface, an error was reported stating {"code": "invalid_maram", "message": "Invalid file URL", "status": 400}. I don't know where the problem is, could you please take a look.
image
params:

{
  "inputs":{
    "documentFiles":[
      {
        "transfer_method":"remote_url",
        "remote_url":"https://pre-resource.kang-boss.com/file/pdf/hvIK6EndcFh50e8f8b9527ff1e2673de954b8c947f92.pdf",
        "extension":".pdf",
        "filename":"hvIK6EndcFh50e8f8b9527ff1e2673de954b8c947f92.pdf",
        "size":43927,
        "mime_type":"application/pdf",
        "type":"document"
      }
    ]
  },
  "query":"解读我上传的文档报告",
  "user":"10086",
  "files":[ ],
  "response_mode":"streaming",
  "conversation_id":""
}

response:

 Response Body: {"code": "invalid_param", "message": "Invalid file url", "status": 400}

thanks;

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @guxiyang on GitHub (Nov 16, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.11.1 ### Cloud or Self Hosted Cloud ### Steps to reproduce Hello, may I ask? I created a workflow in chatflow and initially defined a session variable (documentFiles) of type file list. When I called it through the API interface, an error was reported stating {"code": "invalid_maram", "message": "Invalid file URL", "status": 400}. I don't know where the problem is, could you please take a look. ![image](https://github.com/user-attachments/assets/bfee22c5-16a3-4c69-9d0f-6cf33b111122) params: ``` { "inputs":{ "documentFiles":[ { "transfer_method":"remote_url", "remote_url":"https://pre-resource.kang-boss.com/file/pdf/hvIK6EndcFh50e8f8b9527ff1e2673de954b8c947f92.pdf", "extension":".pdf", "filename":"hvIK6EndcFh50e8f8b9527ff1e2673de954b8c947f92.pdf", "size":43927, "mime_type":"application/pdf", "type":"document" } ] }, "query":"解读我上传的文档报告", "user":"10086", "files":[ ], "response_mode":"streaming", "conversation_id":"" } ``` response: ``` Response Body: {"code": "invalid_param", "message": "Invalid file url", "status": 400} ``` thanks; ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:17:21 -05:00
yindo closed this issue 2026-02-21 18:17:21 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 16, 2024):

I couldn't find specific validation rules for file URLs in Dify's API, but the "invalid_param" error generally indicates abnormal parameter input [1].

Here are a few things you might want to check or try:

  1. URL Accessibility: Ensure that the URL you are using is publicly accessible and not behind any authentication or firewall that could block access.

  2. Correct URL Format: Double-check that the URL is correctly formatted and points directly to the file.

  3. Supported File Types: Make sure the file type is supported by Dify. For documents, supported types include TXT, MARKDOWN, PDF, HTML, XLSX, XLS, DOCX, CSV, and others [2].

  4. Environment Variables: Verify that your environment variables are correctly set, especially if you are using any specific configurations for file handling [3].

If these steps don't resolve the issue, consider checking for any recent changes or updates in Dify version 0.11.1 that might affect file uploads [4].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Nov 16, 2024): <!-- Answer --> I couldn't find specific validation rules for file URLs in Dify's API, but the "invalid_param" error generally indicates abnormal parameter input <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/develop/template/template_advanced_chat.en.mdx)</sup>. Here are a few things you might want to check or try: 1. **URL Accessibility**: Ensure that the URL you are using is publicly accessible and not behind any authentication or firewall that could block access. 2. **Correct URL Format**: Double-check that the URL is correctly formatted and points directly to the file. 3. **Supported File Types**: Make sure the file type is supported by Dify. For documents, supported types include TXT, MARKDOWN, PDF, HTML, XLSX, XLS, DOCX, CSV, and others <sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/file-upload.md)</sup>. 4. **Environment Variables**: Verify that your environment variables are correctly set, especially if you are using any specific configurations for file handling <sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/jp/getting-started/install-self-hosted/environments.md)</sup>. If these steps don't resolve the issue, consider checking for any recent changes or updates in Dify version 0.11.1 that might affect file uploads <sup>[[4]](https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/bulletin.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@guxiyang commented on GitHub (Nov 16, 2024):

I couldn't find specific validation rules for file URLs in Dify's API, but the "invalid_param" error generally indicates abnormal parameter input [1].

Here are a few things you might want to check or try:

  1. URL Accessibility: Ensure that the URL you are using is publicly accessible and not behind any authentication or firewall that could block access.
  2. Correct URL Format: Double-check that the URL is correctly formatted and points directly to the file.
  3. Supported File Types: Make sure the file type is supported by Dify. For documents, supported types include TXT, MARKDOWN, PDF, HTML, XLSX, XLS, DOCX, CSV, and others [2].
  4. Environment Variables: Verify that your environment variables are correctly set, especially if you are using any specific configurations for file handling [3].

If these steps don't resolve the issue, consider checking for any recent changes or updates in Dify version 0.11.1 that might affect file uploads [4].

To continue talking to Dosu, mention @dosu.

Still not working, could you please check if the request parameters are correct,
Request to participate:

{
"inputs":{
"documentFiles":[
{
"transfer_method":"remote_url",
"remote_url":" https://pre-resource.kang-boss.com/file/pdf/hvIK6EndcFh50e8f8b9527ff1e2673de954b8c947f92.pdf ",
"extension":".pdf",
"filename":"hvIK6EndcFh50e8f8b9527ff1e2673de954b8c947f92.pdf",
"size":43927,
"mime_type":"application/pdf",
"type":"document"
}
]
},
Query ":" Interpret the document report I uploaded ",
"user":"10086",
"files":[ ],
"response_mode":"streaming",
"conversation_id":""
}
@guxiyang commented on GitHub (Nov 16, 2024): > I couldn't find specific validation rules for file URLs in Dify's API, but the "invalid_param" error generally indicates abnormal parameter input [[1]](https://github.com/langgenius/dify/blob/main/web/app/components/develop/template/template_advanced_chat.en.mdx). > > Here are a few things you might want to check or try: > > 1. **URL Accessibility**: Ensure that the URL you are using is publicly accessible and not behind any authentication or firewall that could block access. > 2. **Correct URL Format**: Double-check that the URL is correctly formatted and points directly to the file. > 3. **Supported File Types**: Make sure the file type is supported by Dify. For documents, supported types include TXT, MARKDOWN, PDF, HTML, XLSX, XLS, DOCX, CSV, and others [[2]](https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/file-upload.md). > 4. **Environment Variables**: Verify that your environment variables are correctly set, especially if you are using any specific configurations for file handling [[3]](https://github.com/langgenius/dify-docs/blob/main/jp/getting-started/install-self-hosted/environments.md). > > If these steps don't resolve the issue, consider checking for any recent changes or updates in Dify version 0.11.1 that might affect file uploads [[4]](https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/bulletin.md). > > _To continue talking to [Dosu](https://dosu.dev), mention @dosu._ Still not working, could you please check if the request parameters are correct, Request to participate: ``` { "inputs":{ "documentFiles":[ { "transfer_method":"remote_url", "remote_url":" https://pre-resource.kang-boss.com/file/pdf/hvIK6EndcFh50e8f8b9527ff1e2673de954b8c947f92.pdf ", "extension":".pdf", "filename":"hvIK6EndcFh50e8f8b9527ff1e2673de954b8c947f92.pdf", "size":43927, "mime_type":"application/pdf", "type":"document" } ] }, Query ":" Interpret the document report I uploaded ", "user":"10086", "files":[ ], "response_mode":"streaming", "conversation_id":"" } ```
Author
Owner

@dosubot[bot] commented on GitHub (Nov 16, 2024):

The request parameters you provided seem generally correct, but here are a few things to double-check:

  1. URL Whitespace: Ensure there are no leading or trailing spaces in the remote_url. The URL you provided has spaces around it, which could cause issues.

  2. URL Accessibility: Verify that the URL is publicly accessible and not restricted by any network policies or authentication requirements.

  3. File Type and MIME Type: Confirm that the file type and MIME type are supported by Dify. For PDFs, application/pdf is correct.

  4. Transfer Method: Ensure that the transfer_method is correctly set to remote_url.

If these checks don't resolve the issue, consider any recent changes in Dify version 0.11.1 that might affect file URL handling, as there have been updates to the file upload feature [1].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Nov 16, 2024): <!-- Answer --> The request parameters you provided seem generally correct, but here are a few things to double-check: 1. **URL Whitespace**: Ensure there are no leading or trailing spaces in the `remote_url`. The URL you provided has spaces around it, which could cause issues. 2. **URL Accessibility**: Verify that the URL is publicly accessible and not restricted by any network policies or authentication requirements. 3. **File Type and MIME Type**: Confirm that the file type and MIME type are supported by Dify. For PDFs, `application/pdf` is correct. 4. **Transfer Method**: Ensure that the `transfer_method` is correctly set to `remote_url`. If these checks don't resolve the issue, consider any recent changes in Dify version 0.11.1 that might affect file URL handling, as there have been updates to the file upload feature <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/guides/workflow/bulletin.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@fujita-h commented on GitHub (Nov 17, 2024):

Try changing the parameters as follows:

"documentFiles": [
    {
        "type": "document",
        "transfer_method": "remote_url",
        "url": "https://pre-resource.kang-boss.com/file/pdf/hvIK6EndcFh50e8f8b9527ff1e2673de954b8c947f92.pdf"
    }
]
@fujita-h commented on GitHub (Nov 17, 2024): Try changing the parameters as follows: ```json "documentFiles": [ { "type": "document", "transfer_method": "remote_url", "url": "https://pre-resource.kang-boss.com/file/pdf/hvIK6EndcFh50e8f8b9527ff1e2673de954b8c947f92.pdf" } ] ```
Author
Owner

@guxiyang commented on GitHub (Nov 17, 2024):

Thank you, the problem has been resolved. Indeed, the request URL parameter is incorrect. Just replace it with the correct URL.

"documentFiles": [ 
{ 
"type": "document", 
"transfer_method": "remote_url", 
"url": " https://pre-resource.kang-boss.com/file/pdf/hvIK6EndcFh50e8f8b9527ff1e2673de954b8c947f92.pdf " 
} 
]

@.***

发件人: Hiroshi Fujita
发送时间: 2024-11-17 16:04
收件人: langgenius/dify
抄送: 顾夕旸; Author
主题: Re: [langgenius/dify] invalid_param:Invalid file url (Issue #10764)
Try changing the parameters as follows:
"documentFiles": [
{
"type": "document",
"transfer_method": "remote_url",
"url": "https://pre-resource.kang-boss.com/file/pdf/hvIK6EndcFh50e8f8b9527ff1e2673de954b8c947f92.pdf"
}
]

Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>

@guxiyang commented on GitHub (Nov 17, 2024): Thank you, the problem has been resolved. Indeed, the request URL parameter is incorrect. Just replace it with the correct URL. ``` "documentFiles": [ { "type": "document", "transfer_method": "remote_url", "url": " https://pre-resource.kang-boss.com/file/pdf/hvIK6EndcFh50e8f8b9527ff1e2673de954b8c947f92.pdf " } ] ``` ***@***.*** 发件人: Hiroshi Fujita 发送时间: 2024-11-17 16:04 收件人: langgenius/dify 抄送: 顾夕旸; Author 主题: Re: [langgenius/dify] invalid_param:Invalid file url (Issue #10764) Try changing the parameters as follows: "documentFiles": [ { "type": "document", "transfer_method": "remote_url", "url": "https://pre-resource.kang-boss.com/file/pdf/hvIK6EndcFh50e8f8b9527ff1e2673de954b8c947f92.pdf" } ] — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: ***@***.***>
Author
Owner

@fernvenue commented on GitHub (May 16, 2025):

Hi, I have the same issue, and I wanna know what if I upload the files from local instead of using remote files?

@fernvenue commented on GitHub (May 16, 2025): Hi, I have the same issue, and I wanna know what if I upload the files from local instead of using remote files?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6798