- Home /
Transfer closed with bytes remaining to read
To download packages from server I use code like this
void SomeFunction()
{
StartCoroutine(DownloadPackage());
}
IEnumerator DownloadPackage()
{
WWW www = new WWW("http://someserver.com/package.zip");
yield return www;
byte[] package = www.bytes;
File.WriteAllBytes("Some/Directory/package.zip",package);
}
And I have a problem!
Almost always i have an error
"You are trying to load data from a www stream which had the following error when downloading. transfer closed with N bytes remaining to read"
I try to find problem! What it could be? Or it is problem in Unity, or it is problem in internet connection, or server problem!
I try to download this package using web browser and everything good! So I think, that server works perfectly!
So, how to solve this problem? And is there any alternative methods to download files from internet?
Answer by maxoja · Feb 24, 2017 at 05:34 PM
if you still cant solve it you can take a look at this http://answers.unity3d.com/questions/1317949/get-request-with-www-class-done-with-error-transfe.html
Your answer
Follow this Question
Related Questions
How to read text file (.txt) from URL? 3 Answers
Download and saving .txt from server to Android 1 Answer
Unity multiplayer over internet does not work using port forwarding 1 Answer
How to download ,cache gameobjects and use it while playing 0 Answers
Unity 5.6.7 - UnityWebRequest SSL/HTTPs 2 Answers