Jump to content

[SOLVED] How to check files for virus?


ali_kiyani

Recommended Posts

Hello,

I have an application in PHP where users upload different files to server.

Q1. Is there a way I can check those files for virus when user uploads?
Q2. If a virus is found in some file, how can I display message to the user?
Q3. Let's say if I have a dedicated server with antivirus installed, what do I need to do to integrate it with PHP?
Q4. Can this be done on shared hosting environment?

Thanks
Link to comment
Share on other sites

[quote author=ali_kiyani link=topic=116557.msg474996#msg474996 date=1164701746]
Hello,

I have an application in PHP where users upload different files to server.

Q1. Is there a way I can check those files for virus when user uploads?
Q2. If a virus is found in some file, how can I display message to the user?
Q3. Let's say if I have a dedicated server with antivirus installed, what do I need to do to integrate it with PHP?
Q4. Can this be done on shared hosting environment?

Thanks
[/quote]

A1. Yes, after the user upload.
A2. Return a message:

[code]
echo "Go to hell !\n";
[/code]

A3: You can use the command "system()" for execute commands lines and check the files, like this:

[code]
$check = system("antivirus file");

if($check ...
[/code]

A4: Yes.

Link to comment
Share on other sites

  • 3 months later...
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.