www.Error "Failed Downloading"

Hello everybody,

after a few tests in the editor i wanted to try the code on the webplayer. But everytime i want to login and send the request the www.error says "Failed Downloading" Here's the code-example:

var url = createuserUrl + "?username=" + usernameText + "&password=" + Md5.Md5Sum(passwordText) + "&name=" + code + "&email=" + email + "&born=" + born;
var cu_get = WWW(url);
yield cu_get;

if(cu_get.error) {
    console = "There was an error registering: " + cu_get.error;

The Md5 I used is the one from the wiki, without any changes. The createuserUrl is "http://mrjames./..." Its also strange, that this one at the beginning loads fine:

var downloadBackgr : WWW;
downloadBackgr = new  WWW ("http://mrjames.....JPG");
yield downloadBackgr;
backgr = downloadBackgr.texture;

Thanks for every answer

First of all I'd advise that if you're making a form-like request consisting of a number of name & value pairs, you should use the WWWForm class instead. Makes everything much easier to read and debug. Read more about that here.

Second thing is that I can't tell from your question whether that is actually the exact url you're using, or whether it's just a weird example you've chosen to put there. If that is the actual url, then it looks like it simply isn't valid.

Are you uploading the webplayer build to an actual webserver, or are you just testing it locally? If you've uploaded it, you'll need to use the real webserver url - you can use Application.absoluteURL to get this dynamically if you like, or you can hard-code it into your application.

I am having the same error trying to get data from a database using PHP. Did you ever resolve this? I will help pushing this question forward by posting my details for the same error.

I call my script like

    //// Request
    string args = "?user_id=" + user.UserId;

    //// Start download
    var download = new WWW(GetUserURL + args);

    yield return download;

    // Doing some parsing
    // Passing data to requester

GetUserURL is a valid URL. I have tried with WWWForm instead of building arguments my self, but that dont work at all. This current solution works for Standalone builds and from editor, but not on web player. Web player gives error "Failed downloading" both on local web build and web build placed on target site. The domain i place it on is Kongregate and my webserver is hosted on another domain.

I have placed a crossdomain.xml in my domain:

<?xml version="1.0"?>
<allow-access-from domain="*"/>

I print out the page that the program is making its request on and all is fine. If i copy/paste the same text into my browser i get the correct response.

Hope this can help you help us :) Thanks, Niklas


Ok i resolved this now: My problem was that i did not include "http://" in the URL. For some reason it is required in web-builds but not standalone and editor. Hope this was your problem aswell.