WWW class - Transfer closed with bytes remaining to read

I have been messing with the WWW class lately to download something from an ftp server I made with pagej.com. The error says “Transfer closed with X bytes remaining to read” and happens sometimes, about 50% of the times I try to download.
Here is a part of my code:

if(www.text != version && guiText.text == "Update!"){
		guiText.text = "Downloading!";
		www2 = new WWW (gameUrl);
		www2downloading = true;
		yield www2;
		if (String.IsNullOrEmpty(www2.error)){
			System.IO.Directory.CreateDirectory(Application.dataPath + "/Update");
			System.IO.File.WriteAllBytes(Application.dataPath + "/Update" + "/Setup.exe", www2.bytes);
			Application.OpenURL ((Application.dataPath) + "/Update" + "/Setup.exe");
			Application.Quit();
			guiText.text = "Play!";
		}
		else{
			GameObject.Find("Progress").BroadcastMessage("Error", www2.error.ToString());
		}
	}

If I download it manually, its working just fine with no error. Is there a way I can fix it?

I’ve found similar things. And discovered next:
WWW.isDone setted and coroutine will continue only when server normally replies on your request. If I will manually disconnect internet during loading process (for example) - isDone never set! But error will be filled with “transfer closed…etc”. So, I did this by launching parallel coroutine that watches exactly errors until WWW.isDone. And I could catch that situation and handle it to restart loading process for example.

if the solution does not fix your case you can take a look at this