File upload and viruses
How do you perform a virus scan on uploaded files?
I thought to this chances:
Do you call antivirus .COM methods ?
Do you call a "command line" virus interface?
Do you just let the installed antivirus on that system to detect and delete that file? and how your application get notified by this event?
What's your opinion and way?
Thank you!
Hi Leonardo_Da_Vinci , [ u remind me of a very famous artist ;-) ]
WOW, thats quite an interesting question.
I would myself be interested to know the answer.
However I was temped to try out a test. with a free virus scanner [AVG antivirus]
I did the following on the command line...
C:\Documents and Settings\Rohit>"C:\Program Files\Grisoft\AVG Free\avgscan.exe" c:\sea.bmp
AVG7 Anti-Virus command line scanner
Copyright (c) 2005 GRISOFT, s.r.o.
Program version 7.1.381, engine 386
Virus Database: Version 268.5.4/332 2006-05-04
Tested: 0 files, 2 sectors
Infections: 0
Errors: 0
So logically my thinking says the following obvious things:-
a) Your application server [say linux ] should have the antivirus program installed.
b) You should be able to run the antivirus program through some JNI invocation ..maybe
c) Then parse the output line by line for Infections/Errors which will be returned to your program.
I would suggest you to give it a try .. in the meanwhile if any one has a ready to use solution then they can help you out.
Nevertheless I'm keeping this topic in my watch list.
I end this reply with my favourite saying ..
"Imagination equips us to see the reality we are yet to create."
Regards
Rohit Kumar
P.S. I'll be away on vacation for a week. I check this topic again later.
This how you may run external .exe programs from java ..
try
{
Runtime rt = Rintime.getRuntime() ;
Process p = rt.exec("Program.exe") ;
InputStream in = p.getInputStream() ;
OutputStream out = p.getOutputStream ();
InputSream err = p,getErrorStram() ;
//do whatever you want
//some more code
p.destroy() ;
}catch(Exception exc){/*handle exception*/}
This is the best I could do for you Leonardo_Da_Vinci.
I wanna change my Id to SIR ISSAC NEWTON
Cheers
-Rohit Kumar
Hi Anurag ji,
Hmmm .. people do search for previous posts ..
Well ...I havent tested the program myself but I have suggested the way how you should do it. [See my 2nd reply]
But you may post the code as well as compile time error message.
I will try to analyze it.
In case anyone else has working knowledge on this topic then please feel free to advice him .
Hey evnafets ...Madathil_Prasad ..whats your say on this ?
Regards
Rohit
Message was edited by:
RohitKumar