问题描述
我试图在服务器上发送FileReference,并且请求已经执行了,但在服务器端我只有空的ObjectMap。我知道我可以使用URLRequest,但我需要完全rtmps请求。
我的Flex代码:
NetConnection nc = new NetConnection();nc.client = this;
nc.proxyType =best;
nc.connect(connectionURL,3.0,userName,password);
nc.call(uploadFile,null,file);
$ / code>
我的Java代码:
public void uploadFile(Object param){//< - param is empty ObjectMap
log.info(Upload file。)
//在服务器上保存文件
}
任何人都可以帮我吗?解决方案Java不知道如何将FileReference类映射到Java的等价物。在flex中,从FileReference获取ByteArray并将其发送到服务器。 Java知道如何处理一个字节数组。你可以随心所欲地在服务器上完成这个任务。
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.
这篇关于通过rtmps + java在服务器上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!