News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
ClamAV as a Validation Filter in Zend Framework
January 09, 2012 @ 12:20:48

New on PHPMaster.com there's a tutorial showing you how to use ClamAV support to work as a validation filter in a Zend Framework application. ClamAV is an open source project that helps identify malicious threats like trojeans, viruses and malware.

Ok, so you're pretty comfortable with using the Zend Framework, specifically the use of Forms. Along with that, you have a good working knowledge of how to combine a host of standard validators [...] but what do you do when a situation arises that's outside the scope of the pre-packaged validators and filters? Let's say you want to guard against users uploading files that contain viruses, for example. You would have to write a custom validator that checks the uploads aren't infected.

You'll need to install the ClamAV extension on your loal machine for the feature to work. Once it's there, though, it's as simple as setting up the validator (based on Zend_Validate_Abstract) and calling the "cl_scanfile" method on the uploaded file. Also included is the code for a sample controller with a Zend_Form instance and an upload file field to help prove it's working.

0 comments voice your opinion now!
zendframework validation clamav filter virus malware tutorial


blog comments powered by Disqus

Similar Posts

Juozas Kaziukenas' Blog: Zend Framework and Doctrine. Part 2

Stefan Koopmanshcap's Blog: Installing the Geoip PECL package for Zend Server on OSX

Quoderat's Blog: Three simple tips for LAMP web site developers

Brandon Savage's Blog: Making Life Better With The SPL Autoloader

Matthew Turland's Blog: Scaling Zend_Form


Community Events





Don't see your event here?
Let us know!


security interview introduction series release language version update framework symfony community package library podcast opinion laravel tool composer install voicesoftheelephpant

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework