public void Compose(Composition composition)
{
var mediaPath = ConfigurationManager.AppSettings[Helpers.Constants.AppSettings.MediaPath].ToString();
var environment = ConfigurationManager.AppSettings[Helpers.Constants.AppSettings.Environment].ToString();
if (environment == Helpers.Constants.Environments.Local)
{
mediaPath = Path.Combine(mediaPath, Environment.MachineName);
}
composition.SetMediaFileSystem(() => new PhysicalFileSystem(mediaPath, "/files"));
}
This allows me to use media from a network share.
The issue is that it works when I want to upload a new media, the item is created and the file is uploaded but when I click on a media in the library to see its details, the picture does not appear.
It also does not appear on the right pane displaying the thumbnail of images but I figured out that it was because ImageProcessor does not use the path set in the code above, so I had to create a custom ImageService.
Now, I see the thumbnails in the right pane, but clicking on the images does not show them. Moreover, if I access the image directly (like "http://localhost/file/myfile.jpg"), it does not work either.
What more do I have to configure to be able to see the image?
I also needed to create a virtual directory on my development machine to resolve the images.
Just in case someone needs the solution, just locate the applicationhost.config file of your solution (in the .vs) folder and add a virtualDirectory entry like this:
Media on network share: Can upload but not see
Hello,
I configured my media path like this:
This allows me to use media from a network share. The issue is that it works when I want to upload a new media, the item is created and the file is uploaded but when I click on a media in the library to see its details, the picture does not appear.
It also does not appear on the right pane displaying the thumbnail of images but I figured out that it was because ImageProcessor does not use the path set in the code above, so I had to create a custom ImageService.
Now, I see the thumbnails in the right pane, but clicking on the images does not show them. Moreover, if I access the image directly (like "http://localhost/file/myfile.jpg"), it does not work either.
What more do I have to configure to be able to see the image?
Ok, found the solution...
I also needed to create a virtual directory on my development machine to resolve the images.
Just in case someone needs the solution, just locate the applicationhost.config file of your solution (in the .vs) folder and add a virtualDirectory entry like this:
is working on a reply...