Upload Images or Files to Sitecore Media Library via Upload Watcher


Today I am going to share the easiest way to upload images or files to Sitecore Media Library.

Sitecore has a special out-of-the-box feature that uploads the files or images that are placed into /upload directory to Sitecore Media Library automatically.

You can place downloaded files or images in to upload folder for Uploading them to Sitecore Media Library using Sitecore Upload Watcher. You can not place Sitecore packages or Zip files in to upload folder as they cannot be extracted by Upload Watcher automatically.

Sitecore knows there is an image in the upload directory that is ready to be uploaded into the Media Library with the help of Upload Watcher.

Upload Watcher is a Sitecore.IO.FileWatcher that resides in the Sitecore.Resources.Media namespace in Sitecore.Kernel.dll.


The out-of-the-box Upload Watcher knows to monitor the upload directory in the website root of the Sitecore instance as it is defined in Sitecore configuration under /configuration/sitecore/settings/setting[@name=’MediaFolder’]. You can see the value is set to '/upload'.

You can also use a patch configuration file to change the above value if you do not want the Upload Watcher to watch from the upload directory.

For security purposes, it is advised to disable the Sitecore Upload Watcher for uploading files and images to Sitecore Media Library.



References


Chirag Goel

I am a developer, likes to work on different future technologies.

Post a Comment (0)
Previous Post Next Post