Method to create a tmp file and download #6578

Closed
opened 2026-02-21 18:16:23 -05:00 by yindo · 4 comments
Owner

Originally created by @qishibo on GitHub (Nov 5, 2024).

Self Checks

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

1. Is this request related to a challenge you're experiencing? Tell me about your story.

I want to create a file like csv or other format, but when I try open("xxx.txt", "w") and write() I got error like permission denied wherever I place the temp file(tried /tmp /var/sandbox/sandbox-python/tmp/ /var/sandbox/xxx)
I want to know if I can create a custom file by script and then download?

2. Additional context or comments

I also tried to download a file directly via workflow, but I failed to pass file object via Code and got error Object of type File is not JSON serializable(it will success only in start->answer which contains only 2 components and the file passed directly, if I add a code component between then , the error occured)
image
image

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @qishibo on GitHub (Nov 5, 2024). ### Self Checks - [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. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. I want to create a file like csv or other format, but when I try ```open("xxx.txt", "w") and write()``` I got error like permission denied wherever I place the temp file(tried `/tmp` `/var/sandbox/sandbox-python/tmp/` `/var/sandbox/xxx`) I want to know if I can create a custom file by script and then download? ### 2. Additional context or comments I also tried to download a file directly via workflow, but I failed to pass `file` object via `Code` and got error `Object of type File is not JSON serializable`(it will success only in `start->answer` which contains only 2 components and the file passed directly, if I add a code component between then , the error occured) ![image](https://github.com/user-attachments/assets/8b7bc273-8ec4-483d-917e-5e15a0497e18) ![image](https://github.com/user-attachments/assets/e3586908-476c-401d-86d0-1b955d11e75a) ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo closed this issue 2026-02-21 18:16:24 -05:00
Author
Owner

@crazywoola commented on GitHub (Nov 5, 2024):

Duplicated, we are working on add more support to other nodes.

@crazywoola commented on GitHub (Nov 5, 2024): Duplicated, we are working on add more support to other nodes.
Author
Owner

@qishibo commented on GitHub (Nov 6, 2024):

@crazywoola what I asked is the method to create a tmp file and download it, but I got permission denied , which path can I write a new file

@qishibo commented on GitHub (Nov 6, 2024): @crazywoola what I asked is the method to create a tmp file and download it, but I got `permission denied `, which path can I write a new file
Author
Owner

@qishibo commented on GitHub (Nov 8, 2024):

@laipz8200
could you answer this?

@qishibo commented on GitHub (Nov 8, 2024): @laipz8200 could you answer this?
Author
Owner

@laipz8200 commented on GitHub (Nov 8, 2024):

I want to know if I can create a custom file by script and then download?

No, you're not allowed to create any file in the sandbox.

However, if you are interested in this issue, you can always implement this feature in our sandbox.

@laipz8200 commented on GitHub (Nov 8, 2024): > I want to know if I can create a custom file by script and then download? No, you're not allowed to create any file in the sandbox. However, if you are interested in this issue, you can always implement this feature in our [sandbox](https://github.com/langgenius/dify-sandbox).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6578