File Upload via PHP and AntiVirus in Linux?

Posted by wag2639 on Stack Overflow See other posts from Stack Overflow or by wag2639
Published on 2010-03-20T05:55:01Z Indexed on 2010/03/20 6:01 UTC
Read the original article Hit count: 285

Filed under:
|

I was wondering, if I was making a file or image hosting/transfer site, whether or not there was a good approach to check for viruses for files that users are uploading?

I was thinking of this:

  1. Use traditional PHP file upload form to upload the file to the server.
  2. Put files in a queue folder
  3. Move the queue folder to a "process" folder, and replace queue folder after a predetermined limit (time, cronjob, file count, collective file size)
  4. Run a command line virus scan on files in process folder
  5. Place safe files in holding area for use

Is this a good approach?

© Stack Overflow or respective owner

Related posts about antivirus

Related posts about fileupload