File upload through BlazeDS remote object?

Advertisement
Hi,
After researching file upload options in flex, it seems like the only option is through HTTP service requests, such as:
private var fileRef:FileReference;
fileRef.upload(new URLRequest(FILE_UPLOAD_URL));
Is there any way to use BlazeDS remote objects to upload a file from Flex interface? Perhaps passing in a FileReference object and marshalling it into an equivalent Java object?
Thanks!
Advertisement

Replay

I know there is a workaround like this. It uses a servlet to upload a file and returns a url. The uploaded file is either stored in session or server file system until the session expires. Use the PropertyProxy to register a custom class which contains this url and convert to java.io.File. It is the limitation of the player. It cannot read the local file system for security reason. There is a sample in blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/blazeds/qa/remotingService/Echo.java
static
PropertyProxyRegistry registry = PropertyProxyRegistry.getRegistry();
PropertyProxy proxy = registry.getProxy(java.io.File.class);
if (proxy == null)
registry.register(java.io.File.class, new FileProxy());
proxy = registry.getProxy(FileReference.class);
if (proxy == null)
registry.register(FileReference.class, new FileReferenceProxy());
Hope it can help