Media libraries folder

Mark Elliott asked on May 18, 2022 21:42

We currently have seven sites hosted in the same admin instance (v12.0.83). If we leave the default settings value for the Media libraries folder (~/{sitename}/media) when it synchronizes changes to the presentation sites it makes the change only to one of the sites.

In other words if we upload a file to the media library of Site C it will write the file to: www.siteA.com/SiteCName/media

same with any of the other sites - an upload to Site D will go to: www.siteA.com/SiteDName/media

There are no permissions errors or anything else that I can see. It just seems to think that the ~ is always www.SiteA.com

Recent Answers


Amy Patterson answered on May 18, 2022 23:04 (last edited on May 18, 2022 23:06)

Does this help?

https://docs.xperience.io/k12sp/configuring-kentico/configuring-the-environment-for-content-editors/configuring-media-libraries#Configuringmedialibraries-Adjustinggeneralmedialibrarysettings

(Optional) Enable the Use site-specific subfolders for custom media libraries folder option. The system then stores media library files in a sub-folder named as the site code name under the custom files folder. That is,

0 votesVote for this answer Mark as a Correct answer

Mark Elliott answered on May 18, 2022 23:58

Hi Amy, Use site-specific subfolders for custom media libraries folder is something I've looked at in trying to troubleshoot the issue. One of the main potential drawbacks I see is that it only generates perm. urls when using that option.

0 votesVote for this answer Mark as a Correct answer

Amy Patterson answered on May 19, 2022 00:18 (last edited on May 19, 2022 00:19)

In the filesystem, you set a base folder for all of your media libraries. If you don't set one up, ~/(Site name)/media is used - a separate folder per website. If you do set a custom name, then you can designate via a checkbox in the settings, whether to still have site-specific folders, or one big media library folder. So basically you have //MediaLibraryBaseFolder/SiteName?/folder/image.filetype And then there's a Thumbnails folder in each folder, that saves temporary files for when you've shrunk images with /GetMedia/ //MediaLibraryBaseFolder/SiteName?/folder/_thumbnails/imagethumbnail.filetype

I found this nugget of information here:

http://chrisbass.wakeflyexperts.com/blog/september-2018/attachments-and-the-media-library

0 votesVote for this answer Mark as a Correct answer

Mark Elliott answered on May 19, 2022 17:11

I can go in and update all the sites to use a base folder, if left empty though it should be adding media libraries under each site. I'm still mystified as to why its not doing that and instead it's adding all of the site specific folders under one site.

The main drawback I see with setting the Media Libraries Folder base path is that according to the notes on this page: https://docs.xperience.io/k12sp/configuring-kentico/configuring-the-environment-for-content-editors/configuring-media-libraries#Configuringmedialibraries-Adjustinggeneralmedialibrarysettings it indicates that The system always generates only permanent URLs for media files stored in custom media library folders located outside your project.

Not a deal-breaker but it would be a change from how we normally handle files.

0 votesVote for this answer Mark as a Correct answer

Sean Wright answered on June 9, 2022 06:13

Mark,

First off, I would recommend using permanent URLs for media files if there's not a technical limitation in using them. Yes, they don't look pretty but web browsers don't care as long as the server has MIME type mapping and sends the right HTTP response headers to the browser.

Second, I'd check your web farm configuration for your sites. If media is only being synced to 1 application, that leads me to believe your other applications are not processing the web farm tasks correctly (or aren't identified as being in the web farm).

I don't believe any of this is related to the specific path on the filesystem that your media is being stored in.

Another option would be to use shared storage (like a shared file server or Azure/AWS cloud storage) and then configure your application for a shared filesystem

0 votesVote for this answer Mark as a Correct answer

Mark Elliott answered on June 10, 2022 21:30

Hi Sean,

Thanks for following up. The main benefit we got from using the relative paths was when migrating all these sites over to MVC all the files being referenced that way we just had to copy the files to same folder structure on the new sites, no need to back through all the content remapping the links.

I've checked the web farm configuration, everything seems to be ok, showing up healthy.

It really seems that in this multi-site instance when the path is set to the default ~/{sitename}/media it thinks that the ~ is always the domain of SiteA

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.