Skip to content

ImageStash library helps easily leverage azure and amazon to store media files and adds providers to further enhance the protection of your data.

License

Notifications You must be signed in to change notification settings

fit-code/MediaStash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MediaStash

MediaStash library helps easily leverage azure and amazon to store media files. With abstractions and providers for compression and encryption there is an extra layer of perfomance and security.

Let's say you want to encrypt your images upstream/downstream; with MediaStash you can do it with the default provider, or by adding your own custom implementation. You can also chain providers ex: you can encrypt+watermark by simply adding multiple providers.

Getting Started

Take a look at our getting started solution for a fully functionality MVC application.

Sample Upload

   var container = new MediaContainer
   {
       Media = new List<GenericMedia>
       {
            new GenericMedia(_filename, new FileStream($"{_filePath}{_filename}", FileMode.Open).ToByteArray(true)),
            new GenericMedia(_filename, new FileStream($"{_filePath}{_filename}", FileMode.Open).ToByteArray(true)),
            new GenericMedia(_filename, new FileStream($"{_filePath}{_filename}", FileMode.Open).ToByteArray(true))
       }
   };

   _mediaRepository.StashMediaAsync(_azurePath, container.Media).Wait(); 

Sample Download

   // Download file and returns public url.
   var result = await _mediaRepository.GetMediaAsync(_azurePath);
   
   // Just public url.
   var result = await _mediaRepository.GetMediaAsync(_azurePath, true);

Directory Upload

   // Registering to this event will received status of directory upload.
   _mediaRepository.OnDirectoryStash += (n) =>
   {
        Console.WriteLine($"Total Megs: {n.TotalMegabytes.ToString("f2")} Processed: {n.ProcessedMegabytes.ToString("f2")}");
   };
   _mediaRepository.StashDirectoryAsync($"{_dirpath}", true).Wait();

About

ImageStash library helps easily leverage azure and amazon to store media files and adds providers to further enhance the protection of your data.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published