Write to a file in spaces

I am looking for a simple feature where I can log what a user inputs in a text box i.e. save it to a csv/.txt file. Atm, seems like I cannot write to a file and save it to the repo or even cannot open a existing file and append text to it and save it again. Is there some way to record/log user inputs to the repo?

I believe you’re looking for something like this. It’s using a dataset repo to store and reload persistent data.

1 Like

Thank you for sharing this. I’ll def try this but expected something simpler. Looks like it uses a sep repo and some additional HF classes. Wonder if there could be a easier approach.

Spaces have no persistent storage, so if you rebuild/restart a space, those files would be lost. That’s why it’s important to handle things in a separate, dataset repo which is designed for storage

2 Likes

Thanks for the clarification.