9

I have a program that I've been working on that downloads files. Everything works perfectly, unless a user is using AVG. Oddly enough, it seems that in order to fix the issue AVG's "Email Protection" must be disabled; adding either my program or the JRE to an exceptions list doesn't work.

I am downloading content through the use of a BufferedInputStream obtained from a URL. Users have been reporting that the download process starts fine, but freezes ~5%-15% in (it varies). The download progress is shown with a JProgressBar.

Is there any way to avoid this? It's a pain having to deal with it case by case...

Shog9
  • 156,901
  • 35
  • 231
  • 235
Samusaaron3
  • 512
  • 1
  • 7
  • 17
  • Are you using a specific port? Often anti-virus software blocks ports, for example mcafee blocks port 25 by default, so if you're trying to connect directly to an smtp server it won't allow you to do so until you allow that port. – Michael Feb 07 '12 at 01:49
  • I'm using whatever port the InputStream returned by a URL.openStream() uses. http://docs.oracle.com/javase/1.5.0/docs/api/ – Samusaaron3 Feb 07 '12 at 01:52
  • Could you supply the code you're using to create the URL? – Michael Feb 07 '12 at 01:59
  • It's essentially just `URL downloadURL = new URL(link);` where link is a String of the form "`http://domain.com/stuff/stuff.png`" – Samusaaron3 Feb 07 '12 at 02:03
  • AVG have something like "trusted application" when you can add your app to avoid blocks. –  Feb 07 '12 at 02:05
  • URL.openStream() merely calls URL.openConnection().getInputStream(). I'd try using URL.openConnection() to get the URLConnection object, and then use the methods on that to further figure out the problem here. Methods like getContentLength() might help you figure out if it's misreporting the length or something. – Michael Feb 07 '12 at 02:18
  • This problem sounds familiar to me - had the same problem while AVG was installed - may be the solution presented here helps you too: [Stackoverflow: Java: Download always stalls](http://stackoverflow.com/questions/10156133/java-download-always-stalls) – Robert Jan 28 '13 at 09:01
  • 1
    Is it an applet? And what JDK/JRE are you using? – flup Jan 28 '13 at 09:05

3 Answers3

1

Do you download files which contain code of some sort? - That may be why AVG is blocking it.

An easy solution to this (used by virus writers world wide) is to simply transport the source code and compile it client side (Java has a compiler you can call from within your code), or to just encrypt the file, download it in the encrypted form and then decrypt it when you have received the file client side.

ExxKA
  • 930
  • 6
  • 10
0

Try adding java.exe and javaw.exe to the list of trusted applications and not your application specifically.

dsingleton
  • 976
  • 6
  • 7
0

is there a way to add folder to avg exclusion/ trusted list? then add where you have .class. jars, resources and download folder(s) to those. but seems something in the link makes avg think its an email being downloaded. maybe first download a dummy 1 k text file and then the other files?

tgkprog
  • 4,493
  • 4
  • 41
  • 70