+ Start a Discussion

force download of chatterfiles to a single location

My usecase is on click of a button,multiple chatter files should be downloaded at once.

Due to time constraints we are doing this by JS. Looping through URLS as below.But issue is download does happen but if there are three files.three windows are opened and download happens in separate window.is there a way to collect these and make it a better user experience.

This is the VF page

<apex:actionFunction name="clearitem" action="{!clearitems}" rerender="msgs" />
<apex:outputLink onClick="downloaditem();">

This is the JS


<script type="text/javascript">
function downloaditem()
var SFObjectArray = new Array();
<apex:repeat value="{!chatterfileids}" var="arrayItem">

var url = '{!url}';

for (var i = 0; i < SFObjectArray.length; i++)

window.open(url +SFObjectArray[i] );