Hi Brenden Kehren,
Thank you for your quick support. that is a requirement of my client, my client knows technical knowledge Kentico. They want if upload any javascript file in CMS admin after it should sync to MVC via Web Farm.
I tried creating custom web farm synchronization tasks as the article https://docs.xperience.io/k11/custom-development/miscellaneous-custom-development-tasks/web-farm-internals-and-api/creating-custom-web-farm-synchronization-tasks
after that implement code to Changing content file paths to a shared storage
// Registers a custom web farm synchronization task in the system
public void RegisterCustomTask()
{
// Creates a custom web farm task which logs information to the event log
WebFarmTask task = new WebFarmTask
{
Type = "CustomTask",
// Logs a record into the system's event log, with 'Execute' as the event code
Execute = (target, textData, binaryData) =>
{
string message = String.Format("Slave {0} is going to process task from master {1}", SystemContext.ServerName, textData);
EventLogProvider.LogInformation(target, "Execute", message);
// TODO: Slave operation
// Creates a new StorageProvider instance for the Windows file system
var mediaProvider = StorageProvider.CreateFileSystemStorageProvider();
// Specifies the target root directory. The provider creates the relative path of the mapped folders within the given directory.
mediaProvider.CustomRootPath = @"D:\Projects\Kentiko\Sources\makino\BE\admin-local\CMS\makino-cn";
// Maps a directory to the provider
StorageHelper.MapStoragePath("~/CMSScripts/Custom", mediaProvider);
}
};
// Registers the given web farm task
WebFarmHelper.RegisterTask(task);
}
However, it does not work. Please advice
Note: If I only Writing a custom file system provider as the article https://docs.xperience.io/k12sp/custom-development/working-with-physical-files-using-the-api/writing-a-custom-file-system-provider then it work well
Thanks,