0

So I have an app on website.com/app I want the app to save a text variable, and then have the app parse the same text variable to use it later, in a different session, or even on a completely different computer.

It would be even better if website.com/app2 could access the file, but the first case is fine as well.

Would shared preferences work for this, or does every user have one shared preferences? Or does it get wiped when the website is closed?

Thanks!

  • Does this answer your question? [How to save and download text file in Flutter web application](https://stackoverflow.com/questions/59663377/how-to-save-and-download-text-file-in-flutter-web-application) – Spatz May 19 '21 at 18:20
  • @Spatz those seem to be on the right track, except instead of downloading the file I want to put it inside the website. For example, if my flutter webapp folder is website.com/stuff/webappname, I want my (document.txt) file to go here: website.com/stuff/files/document.txt, but I'm not sure how to use those examples to do this? –  May 19 '21 at 22:26

1 Answers1

1

What you are talking about is cross device sharing. SharedPreferences can only help you in case of a single device.

If you want to persist your value against a user across devices, you need to use some backend storage mechanism. Something like firestore which is beginner friendly.

More on it here.

Nisanth Reddy
  • 5,967
  • 1
  • 11
  • 29
  • Is there any way to save text files to a folder in the website itself, and then parse them for use in the webapp? –  May 19 '21 at 17:47
  • You can use `firebase` to handle most kinds of storage necessities. So it you wanted to save text files, firebase provides `Storage` while `Firestore` is more like a table based storage system. More on `Storage` here https://firebase.google.com/docs/storage. – Nisanth Reddy May 19 '21 at 17:53