When you upload files to Sitefinity CMS libraries, you can define whether you require any additional processing logic, applied to these files. You do this using file processors. For example, you can put a brand watermark on each image you upload. Another example is when uploading text files, to add validation for a specific word in the text files.
NOTE: Sitefinity CMS comes with an out-of-the-box SVG sanitizer. For details, see SVG images and JavaScript.
You plug this additional functionality that is executed when an image is uploaded by first implementing the file processor in your project and then adding it as functionality in the Sitefinity CMS backend.
A file processor inherits the FileProcessorBase class. You then need to implement the following two methods:
FileProcessorBase
CanProcessFile
FileProcessorInput
Process
MimeType
FileExtension
In case you need to pass additional parameters to the file processor, you need to override the following method:
Initialize(NameValueCollection config)
All parameters are listed in the config parameter that is passed to the method.
config
To add the newly created file processor as an administration setting in Sitefinity CMS:
After you enable your newly added file processor, it is executed each time you upload the type of file you specified. For an example of how to implement a Watermark maker file processor, see Tutorial: Add watermark to JPEG images.
To edit the properties of a file processor, expand the File processors node and click on the specific processor, for example Svg sanitizer.
NOTE: If you edit the check type, make sure you replace it with a viable type and its parameter.
To delete a file processor altogether, click on the File processors node and then on the trash can icon next to the name of the processor.
NOTE: You can also just disable the file processor if you do not want to execute it for some specific amount of time, for example.
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important