Jump to content

Scanning uploaded files


Tsukiyomi

Recommended Posts

I know this has probably been asked quite a few times, but I can never seem to find an answer with all the details.

 

I'm building a site which will allow people to upload images, word documents, music and if they pay a premium videos.

 

My concern is someone purposefully (or accidentally for that matter) uploading a file infected with a virus.

 

I want to scan all files being uploaded and only copy them to the proper directory once they check out, if they don't I want to delete them and notify the user.

 

My question is how would I go about installing and implementing a virus protector.  I'm totally fine with having to purchase software to install I just need to know what I need, where I can get it and if possible how I use it.

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

Use a free antivirus command line program then use the exec() function to cheek the files needed to be scanned, Then move the files that have been found not to have been infected by the shell program to the correct folder then delete the virused files.

 

This is a pain in realty get a virus program for your server to delete the virus or clean it.

 

why not just run a virus cheek off a night time and clean all files if any files have a virus then delete the virus or clean them that the easy solution.

 

 

Link to comment
Share on other sites

When you delete it you can have your script send an email, add an entry to the database stating that the file has been stripped due to a virus, anything, just have it execute if and only if the file is deleted by the virus scan.

 

My question though is how I get a response from the virus scanner to know what its done.  When I run the program does it automatically return a value for the action its taken or do I have to take special steps?

Link to comment
Share on other sites

That is something that you will have to look in to with the actual software itself.

 

I guess after the scan runs you could then check to see if the file exists in the folder and if it does then it didn't get deleted and if it doesn't then it did get deleted.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.