Just little about C#, .NET, SQL Server, SharePoint and SAP

Download as a Zip file

Posted by zieglers on January 15, 2010

This post is about a new list action feature called ‘Download as a Zip file‘.

MOTIVATION: While using SharePoint document libraries, I’m sure almost all of us, time to time, download bunch of project related documents to local machines and work on them. Due to projects being large-scale, usually number of related documents <half second pause effect> A LOT! 🙂

In order to get all documents to your local drive, as of now, you need to download those documents one-by-one.

However, imagine the flexibility of downloading your documents as a zip file, wouldn’t that be nice?! I think it would 🙂 

Well, let’s not think small here, not only individual documents, but we also want to be able to ‘zip’ a folder, which contains bunch of project related documents, right? Hmm, now it starts to sound more useful..

Ok, let’s imagine more. What about (don’t get too excited, that’s the last one) uploading a zip file of your choice and as soon as it’s upload, it’s extracted automatically and all zipped files are inserted into SharePoint document library?!?!

I think so far we have enough motivation for such a solution. Here is how it’s going to look like.

Download File as a Zip file:

Functionality is tied to ECB menu. Simply, right click document you want to download as zip and select ‘Download as a Zip file‘ option as seen below.

 Once you select that option, file is zipped and you are prompted file download dialog box.

Download Folder as a Zip file:

Functionality is also tied to ECB menu. Actualy you do same clicks for downloading a folder as a zip file. Only difference is you right click folder itself instead of going into that folder.

Based on your selection’s internal type – being either file or folder – ecb menu item is calling associated code piece to execute.

Here is an example: We have a test folder called ‘My Test Folder’ as seen below and two test documents in it, namely TestDOC and TestEXCEL.

 Test Folder:

 Test files in test folder:

Just, right click ‘My Test Folder’ and select ‘Download as a Zip file’. Doing so will zip test folder with all files in it and you will be again prompted File Download dialog box.

 That’s it!!! I’ll update the post when I’m done with upload option.

Note: I’ll post wsp solution for this soon!!!

Please share your thoughts, suggestions …etc.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: