+ Start a Discussion
Newbie10Newbie10 

Multiple file download apex

I have a requirement to download multiple files on a click of visual force button.

i know below will work if its a single file

   <a href="/servlet/servlet.FileDownload?file={!fileId}">

 

any clue about how to gain this for multiple files

Ashish_SFDCAshish_SFDC

Hi, 

 

Where are the files residing are they part of any object or related list? and what type of files they are?

 

Regards,

Ashish

Newbie10Newbie10

they are chatter files.i have ids stored in custom object though

Ashish_SFDCAshish_SFDC

Hi, 

 

You may also try this, 

 

<a href="/servlet/servlet.FileDownload?file={!Document.Id}">Download file</a>

 

I think you can write a forloop for all the IDs in the custom object to download one by one as Salesforce does not recognise the files in one Folder they all are seperate entities. 

 

Regards,

Ashish

Newbie10Newbie10

But again that doesnt trigger downloading of many files on one click.Links exist as different

 

Have you got any sample code?

Ashish_SFDCAshish_SFDC

Hi , 

 

I do not have any sample code, but we can call a Classor controller which can get the links or Ids and process one by one in a For Loop. 

 

Regards,

Ashish

Jay KanchanaJay Kanchana
old post, did you find a solution for this?