Download your Umbraco Media as a zip archive in one click!
Today I release a new package for Umbraco that allows you to easily download files from the Umbraco media library in one click. This is an Umbraco 8 package that allows you to download files from the Umbraco Media Library as a zip archive. You can download both files and folders. When downloading a folder it can include any nested folders and preserves the correct paths (so in theory you could download your entire media library in one zip archive file!).
It came about when I wanted to migrate files from an existing site to a new site. Whilst you could go to the server and copy or FTP the contents of the /Media/ folder in Umbraco, you'd find one big folder with single-level folders with obscure names like 0bkdaww3. The nested structure of the Media library isn't represented on disk - it's preserved in the database instead. So there's no simple way of downloading a file (or the entire folder) and preserving the nested structure you see in the Media tree.
That's where this package comes in - it adds a new Download action to the Media library menu that lets you download either a single file or the current folder as a zip archive. You also have the option of including any nested folders beneath the current folder - and it preserves the structure in the zip archive (to any level).
Note: If you have a large Media library then downloading the entire thing as a single zip archive could take some time!
Browse to the folder you want to download in the Media library:
Select the folder and choose the Download action from the Actions menu (or right click on the folder or file in the tree).
Choose your options in the dialog and confirm:
Then you have your zip archive downloaded nicely on disk, with all the sub-folders preserved:
Why Umbraco 8?
You may be wondering why this package is just for Umbraco 8. Well, the simple reason is that I personally have to manage a lot more Umbraco 8 sites than 9 - and there are probably a lot more Umbraco 8 sites out there. Also, Umbraco already ships with a zip library in the form of SharpZipLib, which was handy. But, once it's thoroughly tested on 8 I will look to migrate it to v9.
But what if your media isn't stored on disk in the conventional way? What if it's in Blob storage or you have a custom Umbraco File System Provider? Well, I'll be honest; I don't know. I suspect it may well not work. But if you know anything definite please let me know!
Like all my packages, they are open-source and completely free. You can find the source-code below (and you are welcome to contribute):