0

Without zipping the files into one archive, is it possible to sequentially send a number of files to download in the client's browser with one click? Something like as in the following code (which is not working, as it would seem we would additionally require to incorporate multiple 'default-response's to achieve the needed multiple http calls).

<transition name="downloadAll" read-only="true"  >
    <actions>
        <entity-find entity-name="mantle.order.OrderContent" list="downloadList">
            <econdition field-name="orderId" />
            <econdition field-name="orderContentTypeEnumId" value="OrctPhoto" />
        </entity-find>
        <iterate list="downloadList" entry="photo">
            <script>ec.web.sendResourceResponse(photo.contentLocation)</script>
        </iterate>
    </actions>
    <default-response type="none" />
</transition>
Ronan Keane
  • 189
  • 8
  • Assume you can do this, how will the client handle multiple files being sent as once? – Ayman Oct 25 '19 at 20:07
  • Thanks for your response. I envisaged they would be sent sequentially. As if you were manually clicking a button for each download. If it makes it clearer, you could put say a 'Thread.sleep(500)' after the ec.web.sendResourceResponse in the iterate loop. Typically on a web browser you would then observe lets say five files indicating they are downloading at the bottom of the browser window etc. But the problem is we then need to incorporate multiple http responses into the loop as well. I'm wondering is that possible at all? – Ronan Keane Oct 29 '19 at 09:32

0 Answers0