Create a file
Last updated
Was this helpful?
Last updated
Was this helpful?
Each Markdown file you create will be stored inside a new . In order for you to be able to retrieve your files, the app needs to add the filename of each file you create to your file index.
The app creates a versioned structured data (type tag 501) with an ID based on your user prefix and the filename. This structured data will contain all the different versions of your file. The first version is encrypted using the cipher options handle previously obtained.
Each version includes the Markdown content and the current time (encoded as a base 64 string).
The app saves the first version of your file by sending a PUT request to the SAFE Network.
The app obtains a data ID handle for the versioned structured data that contains the file you just created.
The app adds the filename and the data ID handle to the global variable representing your file index.
The app updates the structured data that contains your file index. The updated file index contains the name of the file you just created.
The app saves your file index by sending a POST request to the SAFE Network.
The app in order to update the list of files in the UI.