It can only detects after the download, when saving the file to the HDD (if avast is configurated to do so: Standard Shield > created/modified files) or when you try to open the downloaded file (if avast is configurated to do so: Standard Shield > on open files).
I do not think it can detects ‘before’ downloading… Of course, Igor can correct me and said what happened to the ‘deleted’ file :