BlobStorageManager provides general blob storage facilities. When working with blobs you use LibrariesManager to get the album that you are to alter. Blob storage providers configuration is stored in the LibrariesConfig file.
The following sample creates a blob storage provider:
This sample creates an album with the specified blob storage provider and uploads there the images from the specified path. The method parameters are the root folder that contains the images and the name of the blob storage provider.
First, you get the LibrariesManager and create the new album based on the root folder name. Then, you set the blob storage provider for the new album. You can find the available storage providers in Config.Get<LibrariesConfig>().BlobStorage.Providers or BlobStorageManager.ProvidersCollection. Finally, you upload the images from the folder in the album that automatically stores all the images in the location pointed by the blob storage provider.
Config.Get<LibrariesConfig>().BlobStorage.Providers or BlobStorageManager.ProvidersCollection
This sample changes the album blob storage provider and begins transferring album images to the new blob storage location of the album.
NOTE: This could be a long time operation. If it does not finish for some reason, it can be resumed.
The method parameters are the album name and the name of the new blob storage provider for the album.
First, you get the LibrariesManager and the album based on albumName. Then, you get all images that have a blob storage provider different from the new provider and, finally, transfer them to the new location pointed by newBlobStorageProvider.
This sample moves all images from one album to another. If the target album uses different blob storage, the images will be transferred to the target album storage.
The method parameters are the names for the source and target albums.
First, you get the LibrariesManager and the source and target albums based on sourceAlbumName and targetAlbumName. Then, you change the parent for every item to the target album.
Sign up for our free beginner training. Boost your credentials through advanced courses and certification. Register for Sitefinity training and certification.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important