File.WriteAllBytes doesn't work, just write 0 bytes to the file...(android)

hi guys,

I am new to unity…just try to read and write file in android, and it just read fine but writing failed.
I have try to put the file in “Plugins/Android/Assets” or “StreamingAsstes”, any way it read fine, just can’t write to the persistentDataPath , or say, worte but 0 bytes!!

my code(very simple) :

        // i just don't care the file exists or not, just write 

     string filepath = Application.persistentDataPath + "/" + "testword.bytes";

     WWW loadDB = new WWW("jar:file://" + Application.dataPath + "!/assets/" + "testword.bytes");  

      //GameObject.Find("Canvas").transform.GetChild(0).GetComponent<Text>().text = "read failed ";

      while (!loadDB.isDone) {; }  //

        GameObject.Find("Canvas").transform.GetChild(0).GetComponent<Text>().text = loadDB.text+ "read OK";
  /*========untill here, everything is allright, and my Text shows the content and read OK. ===*/
        // then save to Application.persistentDataPath
        try
        {
            System.IO.File.WriteAllBytes(filepath, loadDB.bytes);  //<<<I checked the new file, it just 0 bytes!!
        }
        catch (System.Exception e)
        {
            Debug.LogException(e, this);
            GameObject.Find("Canvas").transform.GetChild(0).GetComponent<Text>().text = "error**"+ e.ToString();
        }

        /*========no exception , but, when I check the file , there is 0 bytes in it.=====*/

Thank you guys, it makes me so crazy (cause I am using Sqlite…simpleSql, it just cannot load any thing)

Have you found solution?

I have the same problem, i am downloading an .mp4 file with WWW class and storing it in Application.persistentDataPath with File.WriteAllBytes and on my android phone i can find the file but it says 0 bytes and can’t be played.

On Windows however it works fine, no problem there.

I have checked i have all permisions to write on my external storage and so on but problem is still there.

I can post my code later, when i get to work…

I cannot find any other thread regarding this issue. If someone sees this please help!