GetFileSystemProvider<MediaFileSystem> - Console App "'No provider found with the alias 'media''"
Hi all just spiking out optimising some already uploaded images where I'd loop through images and run them through tinyfy.com I've hooked this up for the save event for media but wanted to optimise all the legacy/previously uploaded images.
I'm trying to call:
var media = FileSystemProviderManager.Current.GetFileSystemProvider<MediaFileSystem>();
so ultimately I can call something like so:
using (var dataStream = dataResponse.Content.ReadAsStreamAsync().Result)
{
media.AddFile((string)mediaItem.GetValue("umbracoFile"), dataStream, true);
}
and getting 'No provider found with the alias 'media'' I have access to the content type service and media service in the same app with no issues and was wondering what I might be missing.
GetFileSystemProvider<MediaFileSystem> - Console App "'No provider found with the alias 'media''"
Hi all just spiking out optimising some already uploaded images where I'd loop through images and run them through tinyfy.com I've hooked this up for the save event for media but wanted to optimise all the legacy/previously uploaded images.
I'm trying to call:
so ultimately I can call something like so:
and getting 'No provider found with the alias 'media'' I have access to the content type service and media service in the same app with no issues and was wondering what I might be missing.
Thanks
is working on a reply...