Why don't you persist the file in a local file storage, right on the server itself. When the service restarts, it removes content from temporary memory only. The files on the disk are not removed. So that is why I would recommend save that text file on the primary disk itself.
Secondly, also communicate with the web server admins on your hosting provider to know how they would recommend storing these files as. Every server has its own configurations to perform a
clean up.
Edit
Right, I have just read about the process, and more
here[
^], the way I see this is that their entire local system for storing the data is a temporary storage and only your code remains. In this case, the only bid you have is to upload the file somewhere else — on a third-party storage account. You might to handle these events. In mosts cases, I like Microsoft Azure as it provides a lot of control over your content and lets you control when your application restarts and you can then handle these events in your application code. Whereas in their documentation I haven't found this event handler.
If you can find that handler, I would recommend using that handler to upload file.