- Home /
Question by
faridphenom · Oct 27, 2018 at 03:12 PM ·
unity 5www class
www download whole file
Hi, i'm downloading a video file from code using www class that would save file in application.persistentdatapath. in pc it works fine but when i test it in android the code only download 30kb of file and not all of it. what's the problem here?
IEnumerator testDownload(){ Debug.Log ("Downloading"); var www = new WWW("download link"); yield return www; File.WriteAllBytes (Application.persistentDataPath + "/FrontForm.mp4", www.bytes); Debug.Log ("Download!!"); }
Comment
use www.error to see what the issue is
IEnumerator testDownload(){ Debug.Log ("Downloading");
var www = new WWW("download link");
yield return www;
if(www.error!=null){Debug.Log(www.error.ToString());}
File.WriteAllBytes (Application.persistentDataPath + "/FrontForm.mp4", www.bytes);
Debug.Log ("Download!!"); }
Your answer
Follow this Question
Related Questions
WWW Streaming 0 Answers
Unity WWW gzip 1 Answer
Problem using WWW to load text file. 0 Answers
JPG Files, injected with malicious code - What will happen when Unity tries to load them? 0 Answers