Skip to main content
2 of 2
added 201 characters in body
Vlad Iobagiu
  • 18.8k
  • 2
  • 27
  • 53

This happens because your context site is "shell" .

You need to switch to website site using :

   using (new SecurityDisabler())
   {
      var item = mediaCreator.CreateFromStream(ms, fileName, options);
      using (new SiteContextSwitcher(Factory.GetSite("website")))
        {
         var uri = MediaManager.GetMediaUrl(item);
        }
       return uri;
    }
Vlad Iobagiu
  • 18.8k
  • 2
  • 27
  • 53