djangosnippets.org: Latest snippets posted by uandthttps://djangosnippets.org/users/uandt/2008-05-27T00:52:14.600093-05:00uandtScan uploaded file for viruses with clamav
2008-05-27T00:52:14.600093-05:00uandthttps://djangosnippets.org/snippets/774/<p>A clean_&lt;fieldname&gt;() method in a form subclass as described <a href="http://www.djangoproject.com/documentation/newforms/#custom-form-and-field-validation">here</a>. Scans the field named <em>file</em> for viruses.</p>
<p>My version of python-clamav does not support scanning of buffers. That is why I go through the hassle of saving the file to a temporary one.</p>
Freely redistributable