Hi,
I want upload a file to server with the code.
var localFile : WWW = new WWW(“file:///” + Application.persistentDataPath + “/” + fileName);
yield localFile;
if(localFile != null){
print("error " + localFile.error);
}
var form : WWWForm = new WWWForm();
form.AddField(“action”, “envio fase”);
form.AddField(“file”,“file”);
form.AddBinaryData ( “file”, localFile.bytes, fileName, “text”);
var w : WWW = new WWW(“http://www.italomendes.com.br/simonnus/levelupload.php”, form);
yield w;
if(w.error != null){
print( w.error );
}
The error message is:
417 Expectation failed
UnityEngine.MonoBehaviour: print(Object)
$:MoveNext() (at Assets/scripts/inimigoPaiScriptSB.js:929)
What is the solution for the 417 problem?
P.S.: I am using Unity 4.6.