----------------------------------------------------------------------------------------------------------------------------
What file types can I store in NFileStorage?
You can store any file in NFileStorage; there is no limitation; it could be photos, mp3's, torrents, your favourite documentary or whatever you feel like storing in the FileStorage. Note that its a good practise to store only one type of files in a single FileStorage (although you are free to mix various file types in one store if you prefer yourself).
Tip There are overload functions available in the facade that allow you to directly store a string in the FileStore (ofcourse retrieving of a string is available too), so you can also use the NFileStorage to quickly store some in memory state of a string.
Its up to you to organize the FileStorage(s) in your project; maybe you want to use multiple ones at the same time:
- FileStorage 'BigPictures' for storing big pictures
- FileStorage 'Thumbs' for storing thumbnails of the big pictures stored in the 'BigPictures' FileStorage
- FileStorage 'Music' for storing mp3's
- FileStorage 'Icons' for storing icon's used in your project
FileStorageFacade.Create("music", CreateFileStorageBehaviour.IgnoreWhenExists);
FileStorageFacade.StoreFile("music", Guid.NewGuid(), "favourite_song.mp3", AddFileBehaviour.SkipWhenAlreadyExists);
FileStorageFacade.StoreFile("music", Guid.NewGuid(), "another_song.mp3", AddFileBehaviour.OverrideWhenAlreadyExists);
FileStorageFacade.StoreFile("music", Guid.NewGuid(), "nicest_song.mp3", AddFileBehaviour.ThrowExceptionWhenAlreadyExists);
FileStorageFacade.Create("pictures", CreateFileStorageBehaviour.IgnoreWhenExists);
FileStorageFacade.StoreFile("pictures", Guid.NewGuid(), "me.png", AddFileBehaviour.SkipWhenAlreadyExists);
FileStorageFacade.StoreFile("pictures", Guid.NewGuid(), "my_sister.png", AddFileBehaviour.SkipWhenAlreadyExists);
----------------------------------------------------------------------------------------------------------------------------