I need to upload file on server through flex GUI which send file on server with using rtmps protocol.
I tried to send on server just FileReference and request has performed, but on server side i got only empty ObjectMap. I know that I can user URLRequest, but I need exactly rtmps request.
My Flex code:
public function uploadFile(file:FileReference):void{
NetConnection nc = new NetConnection();
nc.client = this;
nc.proxyType = "best";
nc.connect(connectionURL, "3.0", "userName", "password");
nc.call("uploadFile", null, file);
}
My Java code:
public void uploadFile(Object param) { // <-- param is empty ObjectMap
log.info("Upload file.");
// save file on server
}
Can anyone help me?
Java doesn't know how to map the FileReference class to a java equivalent. In flex, get the ByteArray from the FileReference and send that to the server. Java knows how to deal with a byte array. You can do with it on the server as you please then.