You need to sign in to do that
Don't have an account?

How do I Loop Through All the Images in Zip file in Controller
I have one static resource zip file, which has N number of Images. So I don't know the exact number of images are present in zip file.
I just want loop through all the images in zip file. How can I achieve this?. Any help is appreciable.
My VFP page is,
and my controller class is,
I just want loop through all the images in zip file. How can I achieve this?. Any help is appreciable.
My VFP page is,
<apex:page Controller="repeatCon"> <body style="font-size:10pt; font-family:sans-serif"> <table> <td style="font-family:'Segoe UI', Tahoma, sans-serif;"> <apex:repeat value="{!imageList}" var="img"> <td><apex:image url="{!URLFOR($Resource.MinionsDemo,img)}" height="200" width="200" /><br/></td> </apex:repeat> </td> </table> </body> </apex:page>
and my controller class is,
public class repeatCon { public List<string> getimageList(){ List<String> imgstr = new List<String>(); for(integer i = 1; i <= zipfileimagesize; i++){ imgstr.add('Minion/'+i+'.jpg'); } return imgstr; } }in the loop how do I give the size of images present in zip file
The concept is :
However, getContent calls are counted as callouts so you may need multiple requests to figure out how many files you have. I suspect the only way that this will really scale will be a batch job that processes the file, figures out how many files are present and persists this in a custom object or setting.
Then you can use this code in your controller to read the name of the .jpg files inside your zip file: