In Umbraco 8 you do this using a composer to create a custom physical file system instance.
public class MediaComposer : IUserComposer
{
public void Compose(Composition composition)
{
composition.SetMediaFileSystem(() => new PhysicalFileSystem("~/CustomMedia"));
}
}
You'll need to create a custom FileSystemProvider for that, which you can then set using above method:
public class MediaComposer : IUserComposer
{
public void Compose(Composition composition)
{
composition.SetMediaFileSystem(() => new MyCustomFileSystem());
}
}
I have never ran into a situation where reuploading wasn't an option, But I guess if that isn't an option, just uploading the folders in the media section to the remote storage should work if you use the virtual path provider, as the internal relative url's in Umbraco don't change then.
Thanks for your input on how to change the root media folder. It works for me. But I still have a problem with image thumbnails that were uploaded to the custom media folder.
Thumbnails are broken in Umbraco 8.1.3.
Exception says:
File '/media/gepjronu/poster.jpg' is outside this filesystem's root.
Another thing we have found is that we cannot select any images that we upload with a media picker with "Pick only images" enabled. The only place you can click is name of the image which then seems to navigate inside it as if it is a folder.
I think I have just ran into it. I'm using 8.5.5
Created a new PhysicalFileSystem composition that points to a network drive and after I upload an Image, I can't select the image in the cms. It treats the image like a folder, even though the type says Image.
So to future Dan... This seems to happen when changing an existing site. The new image path doesn't get written to the umbracoMediaVersion table. The way I solved my issue was a bit drastic. I just deleted everything in App_Data/TEMP and reloaded the site and it was working fine.
FileSystemProviders Section umbraco 8 to change media location
Hi, Where is the FileSystemProvidersSection in umbraco 8? I wanna change the media location.
In Umbraco 8 you do this using a composer to create a custom physical file system instance.
More about composing you can read here: https://our.umbraco.com/documentation/Implementation/Composing/
Hi Dave,
Is possible to use a network location as media folder with this method?
Thanks!
You'll need to create a custom FileSystemProvider for that, which you can then set using above method:
Though if your network location is the Azure Blob storage you can use the following: https://our.umbraco.com/documentation/Extending/FileSystemProviders/Azure-Blob-Storage/
Ok, then I have to create a totally new class to handle images because the existing one doesn´t support network locations? Wow, a lot of work.
Thanks for your help!
Hi Dave,
Do you know what to do with already uploaded images into /media folder?
Thanks,
Alex
I have never ran into a situation where reuploading wasn't an option, But I guess if that isn't an option, just uploading the folders in the media section to the remote storage should work if you use the virtual path provider, as the internal relative url's in Umbraco don't change then.
Hi
Thanks for your input on how to change the root media folder. It works for me. But I still have a problem with image thumbnails that were uploaded to the custom media folder.
Thumbnails are broken in Umbraco 8.1.3.
Exception says:
Image calling - /umbraco/backoffice/UmbracoApi/Images/GetBigThumbnail?originalImagePath=%2Fmedia%2Fgepjronu%2Fposter.jpg&rnd=0.5137560516892847
what is wrong I suppose.
Thanks,
Alex
I'm encountering the same issue - anybody have a fix?
Hi Lloyd White
Which version of Umbraco are you using?
Thanks, Alex
Hi Alex,
I'm using Umbraco 8.3.0.
Another thing we have found is that we cannot select any images that we upload with a media picker with "Pick only images" enabled. The only place you can click is name of the image which then seems to navigate inside it as if it is a folder.
Hi, Did you manage to solve this issue?
I think I have just ran into it. I'm using 8.5.5 Created a new PhysicalFileSystem composition that points to a network drive and after I upload an Image, I can't select the image in the cms. It treats the image like a folder, even though the type says Image.
So to future Dan... This seems to happen when changing an existing site. The new image path doesn't get written to the umbracoMediaVersion table. The way I solved my issue was a bit drastic. I just deleted everything in App_Data/TEMP and reloaded the site and it was working fine.
Hi Dan,
Can you help me with mapping the media folder to an network drive..
How this can be achieved.
Thanks, Gurumurthy J V
https://our.umbraco.com/Documentation/Reference/Configuration-for-Umbraco-7-and-8/fileSystemProviders/#physical-path
Virtual Folder
IIS Sites > live.abc.com.tr > Media (Virtual Folder)
is working on a reply...