WWW class - Unknown error

Hello,

I’m trying to download the text from the Web Server. I am using WWW class:

    private IEnumerator Test()
    {
        WWW www = new WWW("http://www.mysite.com/cards/test.txt");

        yield return www;

        if (www.error != null)
            errorText.text = www.error;

        cardText.text = ReverseString.Reverse(www.text);
        print(ReverseString.Reverse(www.text));
    }

In the Editor is it works fine. But here on the localhost (On the browser [Firefox]), not works. It is not downloading the text and don’t receive any error.

The error which I am getting: “Unknown error”. I don’t know what a problem here.

Thank you.

Are you trying to download a file from a different domain ? If so, try to setup the cross-domain access as described here

1 Like

Thanks. Yes, I’m trying to download a file from different domain. But, I’m don’t understand good enough what I should exactly to do. I put on the web server the “.htaccess” file which I created:

And Isn’t working. I tried to put the WebGL game on the web server, But then the game isn’t working (It not loading the game).

I don’t know what to do… I’m so disappointed. I will happy if anyone will help me. :frowning:

I changed the format of the file to download the PHP file instead of TEXT file and It works fine with the “.htaccess” file on the Web Server.

I have tried putting the .htaccess file in the root level of target domain but still get the “Unknown Error” is there any other issue for assetbundles in WebGL

1 Like