- Home /
downloading file, saving on android
Im trying to download and save a file using WWW. This is working fine in the editor on windows, havent tested mac or ios yet but its not working on android. The file doesnt turn up in com.name.app/files folder. am i missing something here?
private IEnumerator TestDownload()
{
WWW www = new WWW("http://192.168.1.6/file_drop/zipped_file.zip");
//yield return www;
while (!www.isDone) {
progress = "downloaded " + (www.progress*100).ToString() + "%...";
yield return null;
}
string fullPath = Application.persistentDataPath + "/zipped_file.zip";
File.WriteAllBytes (fullPath, www.bytes);
progress = "downloaded, unzipping...";
...
}
http://forum.unity3d.com/threads/easy-downloader-and-uploader-is-on-assets-store.275372/
This is very good plugin with full support.
Download big files from the web without any memory leaks.... well tested on iOS.
https://assetstore.unity.com/packages/tools/network/large-file-downloader-cross-platform-92128
Answer by niall1111 · Jul 18, 2014 at 12:32 PM
Just a note for anyone else who ends up here via Google. The most likely reason you can't write that file, only on Android, is because you didn't specify that you wanted write access to the disk in your manifest file. See thread here: http://forum.unity3d.com/threads/help-with-access-write-files-on-android.72819/
Your answer
Follow this Question
Related Questions
See Request of WWW or UnityWebRequest, 403 error only from android in a specific url (GET) 2 Answers
OutOfMemoryException when downloading files via the www class (iOS and Android) 1 Answer
Download and saving .txt from server to Android 1 Answer
Downloading image from the server crash the game in Android Device ? 1 Answer
Download and save files on iphone? 1 Answer