Hi guys.
I forgot to mention that I have successfully integrate Flex Upload with the Sling by using the as3httpclient as Oliver recommends. The main issue that I met after that was the sling.formauth cookie. But with the as3httpclient I managed to extract the cookie and everything works fine now. For now I am trying to implement Flex object persistence to JCR object in the repository, by using some kind of "Active Record" pattern. If I able to produce a working version I will commit it as an open source library.

Thanks again.
Dimitar.

On 08/29/2012 11:37 PM, Oliver Lietz wrote:
Am Wednesday, 29. August 2012 schrieb Dimitar Dimitrov:
Hello everyone.
hello Dimitar,

I am trying to implement the file upload functionality to Sling from
Adobe Flex based client.
I tried all of the possibilities in the Flex FileReference.upload()
method but unsuccessfully. Then I saw that Flex client sends properties
of the request differently than the standard HTTP form.
The main issue is that I am trying to upload the file into the nt:folder
element and Slings returns the IOError event. After some investigations
I found that the Sling tries to create a property with name
"{}Filename", which is actually sent from the Adobe flash player. If I
try to upload a file into the nt:unstructured node everything is OK, but
the file did not stands as a nt:file. There is an another issue that can
produce IOError event. The Flash player in Firefox did not send the
authentication parameters from the cookie. There are some workarounds
that can fix this issue, so my problem is not in the authentication.
After that I decide to make a PUT call to the Sling, but it turned out
that the browser's flash player did not support PUT HTTP Request. So the
next step that I decide to do is to produce my own PostOperationServlet
which can do the actual nt:file creation from custom HTTP POST request.
I am almost done but just in case I decide to ask you about the other
possibility which can do the browser based Adobe Flex upload to Sling.
use as3httpclient[1] instead. I was able to successfully POST files to Sling.

regards,
O.

Thanks in advance.
Dimitar
[1] https://github.com/gabriel/as3httpclient

Reply via email to