Hi there,
I need to load a dict from an user uploaded file (JSON, other format?), use it (easy part) and then export it again to the user. So it would all live in the browser with no trips server side.
What would be the best way to approach this? I know close to nothing of JavaScript so a more verbose explanation would be helpful.
Hello,
Check out the documentation on media objects (and the File Uploader component for uploading). If you have your data in a media object you can do download(my_media)
to have it downloaded. Please let us know what you have tried with code when you’ve explored the related docs.
4 Likes
Yeah, I figured it out. I just needed to adapt some code for python3 on the browser side (and workaround the client-side datetime module limitations for data processing with some string slicing…).
Here’s a simple live demo .
And a clone link for someone that might find it useful.
https://anvil.works/build#clone:XD25WA3GPVEOPLOO=67SV43BWNFKYXRSIHJPJMTE4
3 Likes