I am writing a code to upload a zip file to client server. I am using Flash Builder 4.6, Extension Builder 2.1 on a Win 7 machine. My request includes login and password authentication and other params. I am sending the file contents as byte array. But, the return code I get from the server suggests that it does not receive any file. It gets null in the file parameter.
Here is my code,
var request:URLRequest = new URLRequest("http://<url>api/plugin.php/");
request.method = URLRequestMethod.POST;
var fileStream:FileStream = new FileStream();
var byteArr:ByteArray = new ByteArray();
fileStream.readBytes(byteArr, 0, fileStream.bytesAvailable);
request.data = "login=" +
var loader:URLLoader = new URLLoader();
// Call OnSuccessfulExportif export completes
// Call OnUnsuccessfulExportif export failed
private function OnSuccessfulExport(event:Event):void
I get a callback on OnSuccessfulExport function, but the value returned from the server in event.target.data is that the server received no file.
Am I missing something here?