File url is invalid. #12077

Closed
opened 2026-02-21 19:05:39 -05:00 by yindo · 4 comments
Owner

Originally created by @Velvet0314 on GitHub (Mar 25, 2025).

Originally assigned to: @ZeroZ-lab on GitHub.

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

1.1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When I was in dify v1.1.0, I upload the image from url, there's an error below:

Image

Now I update dify to v1.1.3, error is nor shown. But it directly tell me that "Invalid file link 文件链接无效" .

I'm sure that the oss file is right, because I can use browser to download the picture.

http://wikkii.oss-cn-qingdao.aliyuncs.com/sketch/Sketch1.png

And both http and https is invaild.

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @Velvet0314 on GitHub (Mar 25, 2025). Originally assigned to: @ZeroZ-lab on GitHub. ### 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 1.1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When I was in dify v1.1.0, I upload the image from url, there's an error below: ![Image](https://github.com/user-attachments/assets/1417cceb-bb6a-4803-8f24-f1af8df112cc) Now I update dify to v1.1.3, error is nor shown. But it directly tell me that "Invalid file link 文件链接无效" . I'm sure that the oss file is right, because I can use browser to download the picture. `http://wikkii.oss-cn-qingdao.aliyuncs.com/sketch/Sketch1.png` And both `http` and `https` is invaild. ![Image](https://github.com/user-attachments/assets/97600ea0-400a-48f8-9dff-c943b2906a12) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 19:05:39 -05:00
yindo closed this issue 2026-02-21 19:05:39 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 25, 2025):

The issue you're experiencing with the "Invalid file URL" error in Dify version 1.1.3 is likely due to stricter validation rules for file URLs in this version. The validate_after method in the File class now checks if the remote_url is a string and starts with "http". If the URL does not meet these criteria, it raises a ValueError with the message "Invalid file url" [1].

To resolve this, ensure that your file URL is correctly formatted and starts with "http". If the URL is correct and still not working, you might want to check if there are any additional network or configuration issues affecting the URL validation.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 25, 2025): <!-- Answer --> The issue you're experiencing with the "Invalid file URL" error in Dify version 1.1.3 is likely due to stricter validation rules for file URLs in this version. The `validate_after` method in the `File` class now checks if the `remote_url` is a string and starts with "http". If the URL does not meet these criteria, it raises a `ValueError` with the message "Invalid file url" <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/file/models.py)</sup>. To resolve this, ensure that your file URL is correctly formatted and starts with "http". If the URL is correct and still not working, you might want to check if there are any additional network or configuration issues affecting the URL validation. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/4adc9315-4d0b-4974-90c8-b1532eb96978?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/4adc9315-4d0b-4974-90c8-b1532eb96978?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/4adc9315-4d0b-4974-90c8-b1532eb96978?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/4adc9315-4d0b-4974-90c8-b1532eb96978?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4adc9315-4d0b-4974-90c8-b1532eb96978?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/4adc9315-4d0b-4974-90c8-b1532eb96978?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/4adc9315-4d0b-4974-90c8-b1532eb96978?feedback_type=other)</sup>
Author
Owner

@ZeroZ-lab commented on GitHub (Mar 25, 2025):

The link contains spaces.
Do you need me to fix it? trim the spaces
@crazywoola

@ZeroZ-lab commented on GitHub (Mar 25, 2025): The link contains spaces. Do you need me to fix it? trim the spaces @crazywoola
Author
Owner

@Velvet0314 commented on GitHub (Mar 25, 2025):

@ZeroZ-lab I'm sorry that when I copy my link with space, I will later test my chatflow app with correct link.Thanks for your tips.

@Velvet0314 commented on GitHub (Mar 25, 2025): @ZeroZ-lab I'm sorry that when I copy my link with space, I will later test my chatflow app with correct link.Thanks for your tips.
Author
Owner

@crazywoola commented on GitHub (Mar 25, 2025):

The link contains spaces. Do you need me to fix it? trim the spaces @crazywoola

https://github.com/langgenius/dify/issues/16693

Thanks, you can take a look at this issue as well. I will assign them to you.

@crazywoola commented on GitHub (Mar 25, 2025): > The link contains spaces. Do you need me to fix it? trim the spaces [@crazywoola](https://github.com/crazywoola) https://github.com/langgenius/dify/issues/16693 Thanks, you can take a look at this issue as well. I will assign them to you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12077