Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to download multiple documents from document library. I select several documents and then click on 'download' icon present in ribbon. It should download all files and retain its metadata. 'Download' should be custom action in ribbon. Can anyone please provide me custom code for the same.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

That's more a case of LMGTFY - Here's a complete tutorial plus a .wsp to add this function.

To get some basic understanding

Since you can't download multiple files in one response, you need to package them in a .zip for example. What you have to do is getting the byte[] foreach file and package them together. Then add created .zip to the response to invoke a download dialog.

share|improve this answer
    
Hi, Thanks a ton :) –  user21081 Jul 2 at 12:06
    
I also got another link while googling adicodes.com/download-files-as-zip-file-in-sharepoint This blog is reference of same blog you provided, but in this blog he changed a code little bit. can you please help where exactly code need to be changed wrt your link –  user21081 Jul 2 at 12:07
    
There is a problem when you are not at root level. The comments in the blog I referred are giving a lot of extra information. Example - deviantpoint.com/post/2010/05/08/… –  Max Jul 2 at 12:12
    
yes, so where exactly we need to make code change if I have to do same in subsite? code is provided in link provided by me.. but i cannot judge where exactly change need to be made(in which file) –  user21081 Jul 2 at 12:50
    
as written in the comment I linked in my previous comment "I changed Ln36 in CustomAction.js to form.setAttribute("action", this.site.get_url() + "/_layouts/deviantpoint.downloadzip/downloadzip.aspx"); and Ln16 in DownloadZip.aspx.cs to string docLibUrl = fullDocLibSourceUrl;" -- See more at: deviantpoint.com/post/2010/05/08/… –  Max Jul 2 at 12:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.