- Home /
How to stop a WWW which is in progress?
Say you're downloading a large image using WWW.
How do you actually stop the download ?
Note - StopAllCoroutines simply does not work.
If you set the WWW to null, that does not work.
You can't Destroy(WWW) so that does not work.
Any ideas? Anyone?
Answer by PushpaK · May 29, 2013 at 12:53 PM
If you want to cancel download manually on any button you can call Dispose method on your www object. e.g.
WWW w = new WWW(url);
yield return w;
and on cancel call below code
if( w != null) { w.Dispose(); }
I have used it in my game and it works.
Hello! Sorry I have not had a chance to try it yet, but awesome. You should also answer this identical question, for more points!
http://answers.unity3d.com/questions/464113/stopallcoroutines-does-not-cancel-a-yield-www-down.html
but heads-up android devs. according to other threads, if your request is ti$$anonymous$$g out, it seems like Dispose() will wait until the request times out, which is 60s.
Your answer
Follow this Question
Related Questions
Download a file to project 0 Answers
Where is downloaded things from editor script being saved? 0 Answers
Downloading files in the Editor 2 Answers
iOS download files and store to local drive 4 Answers
downloading file, saving on android 1 Answer