tags:

views:

24

answers:

1

I need to write a webscript in alfresco that returns to the user a single zip file that contains several files, some of them created on the fly by the script and some of them stored on the server.

How can i do it?I know how to create different files on the server, i don't know how to zip them and how to include files that are stored on the server.

A: 

Well, you can develop a Java action that would do the zipping part.

Last time I was looking into this, I didn't find an out-of-the-box solution.

As for returning, you can specify that by specifying webscript format, ie:

<format default="html">any</format>

Only, there is a problem, you can't set a zip format, but alfresco wiki says how you can add more:

http://wiki.alfresco.com/wiki/3.0_Web_Scripts_Framework#HTTP_Response_Formats

Edit: I just found this thread (while looking for a solution for another problem). In the thread a custom "unzip" action is described, maybe you can use that to add a zip/unzip action in your alfresco installation and use it.

zladuric