Saving files #1860
Replies: 2 comments
-
You don't need to create a data url in dioxus-desktop. Your code runs natively, so you can use any of the std filesystem functions without going through the browser |
Beta Was this translation helpful? Give feedback.
-
I'm trying to do the same thing except in a web env - when a button is pressed generate some JSON and trigger download (maybe with filename prompt). Any doc on how to accomplish this? I'm tempted to try to hack this in by just generating a data URI that always contains the JSON and then putting that behind a regular link... no idea if this would work though. And obviously expensive if JSON is large. |
Beta Was this translation helpful? Give feedback.
-
I'm in a desktop environment, and reasoned out how my application can load files from disk using the file input element. However, I'm currently struggling to understand how to do the reverse - generate a file in my application, and present a save file dialog.
What is the correct way to do this? It doesn't look like
rfd
is being reexported from the desktop package, and while I suppose I could just add that dependency to my project it feels like I'm missing a more idiomatic way of presenting a new file dialog. I assume an HTML file download is the right approach, but am unclear as to how best to generate this file (data URL?) and trigger a download.Beta Was this translation helpful? Give feedback.
All reactions