public FileSystemStorageProvider(FileSystemSettings settings, IWebHelper webHelper) { var mediaPath = webHelper.MapPath("~/Media/"); _storagePath = Path.Combine(mediaPath, settings.DirectoryName); var appPath = ""; if (HostingEnvironment.IsHosted) { appPath = HostingEnvironment.ApplicationVirtualPath; } if (!appPath.EndsWith("/")) appPath = appPath + '/'; if (!appPath.StartsWith("/")) appPath = '/' + appPath; _publicPath = appPath + "Media/" + settings.DirectoryName + "/"; }