Downloading files from wepage and saving on android ,Download from webpage, and open it on android
Hello,
I would like to have option like that:
Someone who click button "download image": then program will download image, and will open image not in Unity, by in your local program to images.
I have code like that:
     private IEnumerator TestDownload()
     {
         WWW www = new WWW("https://www.szerokikadr.pl/public/repozytorium/poradnik/201211/3/160_732388c2.jpg");
         yield return www;
 
         while (!www.isDone) {
 
             Debug.Log( www.progress ) ;
             yield return null;
         }
 
     
         string savePath = Application.persistentDataPath + "/picture.jpg";
 
         byte[] bytes = www.bytes;
 
         File.WriteAllBytes(savePath, bytes);
         Application.OpenURL(savePath);
 }
 
               But it shows me that this file doesn't exist.
I would be really grateful if someone could help me : ) Thank you in advice, and have a nice day.
Answer by dbordzo · May 20, 2016 at 04:10 PM
Ok I solve this by:
File -> Build Settings ->Player Settings
Inspector -> Other Settings -> Configuration -> Write Access ->External( sdcard)
now it's seems to work : )
Your answer
 
             Follow this Question
Related Questions
Help offline progression, works on windows but not on Android. 0 Answers
How to deploy app with "pre-installed data"? 1 Answer
Are playerprefs a safe way of saving data or not?? 2 Answers
Unity Analytics Dashboard + Event Manager still empty after days waiting for data population 1 Answer
PlayerPrefs works fine in Unity Editor but not on Android 0 Answers