workflow code module get image url is "" #11858

Closed
opened 2026-02-21 19:04:24 -05:00 by yindo · 2 comments
Owner

Originally created by @yj11 on GitHub (Mar 20, 2025).

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.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I want to get the image url and encode the image in base64.
But image url output "".

✔️ Expected Behavior

output image url

Actual Behavior

Image

Originally created by @yj11 on GitHub (Mar 20, 2025). ### 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.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I want to get the image url and encode the image in base64. But image url output "". ### ✔️ Expected Behavior output image url ### ❌ Actual Behavior ![Image](https://github.com/user-attachments/assets/9feb6b86-0a6a-4e53-8101-9b1a66e2a38a)
yindo added the 🐞 bug🌊 feat:workflow labels 2026-02-21 19:04:24 -05:00
yindo closed this issue 2026-02-21 19:04:25 -05:00
Author
Owner

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

The issue you're experiencing with the image URL output being empty in Dify version 1.1.0 might be related to the method you're using to retrieve the image URL. In Dify 1.1.0, you should use the get_signed_temp_image_url method from the UploadFileParser class to generate a signed temporary URL for the image using the upload_file_id [1].

Here's a code snippet that demonstrates how to use this method:

@classmethod
def get_signed_temp_image_url(cls, upload_file_id) -> str:
    base_url = dify_config.FILES_URL
    image_preview_url = f"{base_url}/files/{upload_file_id}/image-preview"

    return UrlSigner.get_signed_url(url=image_preview_url, sign_key=upload_file_id, prefix="image-preview")

This method constructs the image preview URL and then uses UrlSigner.get_signed_url to return a signed URL. Make sure you are using this approach to retrieve the image URL in your workflow code module.

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 20, 2025): <!-- Answer --> The issue you're experiencing with the image URL output being empty in Dify version 1.1.0 might be related to the method you're using to retrieve the image URL. In Dify 1.1.0, you should use the `get_signed_temp_image_url` method from the `UploadFileParser` class to generate a signed temporary URL for the image using the `upload_file_id` <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/file/upload_file_parser.py)</sup>. Here's a code snippet that demonstrates how to use this method: ```python @classmethod def get_signed_temp_image_url(cls, upload_file_id) -> str: base_url = dify_config.FILES_URL image_preview_url = f"{base_url}/files/{upload_file_id}/image-preview" return UrlSigner.get_signed_url(url=image_preview_url, sign_key=upload_file_id, prefix="image-preview") ``` This method constructs the image preview URL and then uses `UrlSigner.get_signed_url` to return a signed URL. Make sure you are using this approach to retrieve the image URL in your workflow code module. <!-- 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/10555d40-10ea-4508-8309-28a6d308e53d?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/10555d40-10ea-4508-8309-28a6d308e53d?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/10555d40-10ea-4508-8309-28a6d308e53d?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/10555d40-10ea-4508-8309-28a6d308e53d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/10555d40-10ea-4508-8309-28a6d308e53d?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/10555d40-10ea-4508-8309-28a6d308e53d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/10555d40-10ea-4508-8309-28a6d308e53d?feedback_type=other)</sup>
Author
Owner

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

Duplicated.
This is a signed url, which can be accessed in some nodes only, however. you can not get this in HTTP or Code node.

  • You can get file.url if this is uploaded from remote url which returns the original url
  • You can not get file.url as this is a signed url, and it can not be used a few minutes or hours later.
@crazywoola commented on GitHub (Mar 20, 2025): Duplicated. This is a signed url, which can be accessed in some nodes only, however. you can not get this in HTTP or Code node. - You can get file.url if this is uploaded from remote url which returns the original url - You can not get file.url as this is a signed url, and it can not be used a few minutes or hours later.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#11858