As this URLFOR takes Id as a parameter for the Attachement you want to download. So if you can pass Id dynamically for all the attachment you want to download ... like by using {!URLFOR($Action.Attachment.Download, Id)} inside a loop which open these link repeadly. You can acheive this by using apex:repeat and javascript.
//listOfAttacmentI is a list of Id having all attachment you want to download.
<apex:repeat value="{!listOfAttacmentI} var="attachId" >
<script>
window.open('{!URLFOR($Action.Attachment.Download, attachId)}','_blank') ;
<script>
</apex:repeat>
Hope above code will help you. Please modify it according to your need.
Please mark my answer as a best solution to your question to help others if it solves your problem.
As this URLFOR takes Id as a parameter for the Attachement you want to download. So if you can pass Id dynamically for all the attachment you want to download ... like by using {!URLFOR($Action.Attachment.Download, Id)} inside a loop which open these link repeadly. You can acheive this by using apex:repeat and javascript.
//listOfAttacmentI is a list of Id having all attachment you want to download.
<apex:repeat value="{!listOfAttacmentI} var="attachId" >
<script>
window.open('{!URLFOR($Action.Attachment.Download, attachId)}','_blank') ;
<script>
</apex:repeat>
Hope above code will help you. Please modify it according to your need.
Please mark my answer as a best solution to your question to help others if it solves your problem.
Are you getting any error or how it's not working for you ? As tried the above code and it's working for me. The above code will open all your attachment associated with {!a} in a new link from there you can download them. Please check your POP allocation Option for the browser.
Hope above code will help you. Please modify it according to your need.
Please mark my answer as a best solution to your question to help others if it solves your problem.
All Answers
Hope above code will help you. Please modify it according to your need.
Please mark my answer as a best solution to your question to help others if it solves your problem.
i am using above code inside button
<apex:commandButton value="download" title="download" rerender="tab">
<apex:outputPanel id="tab">
<apex:repeat value="{!a}" var="attachId" >
<script>
window.open('{!URLFOR($Action.Attachment.Download, attachId)}','_blank') ;
</script>
</apex:repeat>
</apex:outputPanel>
</apex:commandButton>
but its not working there
Please check your POP allocation Option for the browser.