1. 在Flex端,使用FileReference获得下载的文件,然后获取file的byte数组,以及file name
var data:ByteArray = refUploadFile.data;
var fileName:String = refUploadFile.name;
2. 在java端,设置一个blazeds的service进行接受,代码类似如下:
public String doUpload(byte[] bytes, String fileName) throws Exception
fileName = "D:/a/" + fileName;
File f = new File(fileName);
FileOutputStream fos = new FileOutputStream(f);
fos.write(bytes);
fos.close();
return "success";