You should combine Avast with Dr-Web.They make a perfect pair.First,you scan the online file for viruses using Dr. Web.If a virus is detected,the next step goes without saying...If a virus is not detected,then,you could click on the download link first.Once,you are prompted to download the file,avast will signal you if the file contains a virus,the latest the detection will be when you download the file,like what Nazzgull said.The disadvantage of Dr. Web is that it can only detect major viruses like trojans.Other stuff like adware would not be detected.Actually,after the file has crossed these two security barriers,you could use a powerful antivirus program to scan it before opening.This will make sure that the file that you downloaded is 99% safe.Just do not download any PROGRAMS OR .EXE FILES from P2P programs or servers like minninova,emule,bittorrent,Kazza,etc.OR from any crack,keygen,illegal sites.Also remember to clear your browsing history regularly.Your computer should be free of viruses in this way.