AnsweredAssumed Answered

Java-backed webscript to return a file (comes in byte[] format)

Question asked by sunquanbin on Jan 30, 2014
Latest reply on Feb 14, 2014 by sunquanbin
Hi Everyone,

My scenario is that I have a Java-backed webscript which interacts with third-party library and as a result, a file is returned (in byte[] type).
My question is how can I convert this byte[] into a file and pass it back in the webscript response (I only knew how to create a JSON response)?

The solution I could think of was to
1.create a node in alfresco and put that byte[] as its content.
2.get the download url for the created node content
3.put this url in the JSON response.

I am sure there must be a more simpler solution to my existing one as I'm new to Alfresco.

Can anyone help?

Many thanks