Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Does this also work with MediaService so that any media created in code is also pushed to Azure Blob Storage?
It should work for Azure Blob Storage.
Thanks very much for the quick response!
Something like this is what I currently have:
string originalPath = "uploadedImages\\test.png";
IMediaService mediaService = ApplicationContext.Current.Services.MediaService;
var newImage = mediaService.CreateMedia("myTestImage", -1, "Image");
byte buffer = System.IO.File.ReadAllBytes(System.IO.Path.GetFullPath(HttpContext.Current.Server.MapPath(originalPath)));
System.IO.MemoryStream strm = new MemoryStream(buffer);
newImage.SetValue("umbracoFile", "myNewImage.png", strm);
So are you saying that calling the mediaService.Save(newImage) method should automatically drop this into Blob Storage (assuming everything is set up correctly)?
At the moment, it appears to be creating it in the default way (i.e. creating the media file in the media section of my file system).
Rick, did you make config changes for Azure Blob Storage ?
Yes I have - according to the documentation on the package page.
try the regular media upload in Umbarco back office.
When the uploaded files are in the cloud your configuration is fine.
But if the MediaService does not store in the cloud it is an issue in the core and you should report this on:
This package is just an implementation of IFileSystem and configured to be use for media items.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted