EPrints Technical Mailing List Archive
Message: #05349
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: Virus Scan during Upload
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: [EP-tech] Re: Virus Scan during Upload
- From: "Brian D. Gregg" <bdgregg@pitt.edu>
- Date: Mon, 25 Jan 2016 15:52:39 +0000
Martin, This is what we us in our IR (running EPrints 3.2.8). It could probably be written a bit better (obviously – feel free to tweak as anyone sees fit), but works
as is for us currently. You will need ClamAV installed (including the associated PERL modules). This part goes into the cfg/cfg.d/document_validate.pl file under the “CHECKS IN HERE” comment but before the “return ( @problems );” # Virus scan the uploaded files. my %files = $document->files; my $path = $document->local_path; while ( my ($filename, $size) = each(%files)) { # for each file uploaded use File::Scan::ClamAV; my $av = new File::Scan::ClamAV(find_all => 1, port=> '/tmp/clamd'); my $filetoscan = "$path/$filename"; my %caught = $av->scan("$filetoscan"); while (my ($k,$v) = each %caught ) { # Viruses Found push @problems, $session->html_phrase( "validate:virus_found", filename => $session->make_text($filename), virus => $session->make_text($v) ); } } # End Virus scan. And the HTML Phrase can go into the file cfg/lang/en/validate.xml
<epp:phrase id="validate:virus_found">The file that has been uploaded contains a virus. The file in question is: <epc:pin name="filename"/>. It contains the
virus: <epc:pin name="virus"/>. Please remove the file and upload a virus free version.</epp:phrase> Hope this helps or at least points you in a direction as to what you might need. Thanks, Brian Gregg. Brian D. Gregg Solutions Architect
| Manager Systems Development University of Pittsburgh | University Library System Address:
7500 Thomas Blvd. Room 129 Pittsburgh, PA 15208 Tel: (412) 648-3264 | Email:
bdgregg@pitt.edu | Fax: (412) 648-3585 https://orcid.org/0000-0001-6541-4544 From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of martin.braendle@id.uzh.ch Hi, |
- References:
- [EP-tech] Virus Scan during Upload
- From: martin.braendle@id.uzh.ch
- [EP-tech] Virus Scan during Upload
- Prev by Date: [EP-tech] Virus Scan during Upload
- Next by Date: [EP-tech] Re: EPrints 3.3.15 released
- Previous by thread: [EP-tech] Virus Scan during Upload
- Next by thread: [EP-tech] Antwort: Re: Virus Scan during Upload
- Index(es):