Resurrecting umbdashboard part 1: Zip Upload, bulk upload files to the media section of umbraco
Umbdashboard which can be found on codeplex is a collection of handy umbraco dashboard controls (some info on dashboard). But it’s an old project developed for a previous version of umbraco. So I’ve started porting these to umbraco v4. First up is zip upload.
Basicly zip upload is a small dashboard control that allows you to upload a zip file to the media section of umbraco. All files in the zip get created as media items and it also respects folder structure.
Once it’s installed you can find it on the dashboard of the media section.
So you can pick a media folder (if no folder is selected it creates a new folder based on the zip filename).
And you just need to choose the zip file and hit ‘upload zip file’.
Afterwards you’ll get a summary of the files that have been uploaded.
If you refresh the media tree, files and folders should be in place
Zip upload has a small configuration file (/config/zipupload.config) that looks like this:
<?xml version=”1.0″ encoding=”utf-8″ ?>
<zipUpload>
<fileNodeTypeId>1033</fileNodeTypeId>
<imageNodeTypeId>1032</imageNodeTypeId>
<folderNodeTypeId>1031</folderNodeTypeId>
<imageFileExtensions>jpeg,jpg,gif,bmp,png,tiff,tif</imageFileExtensions>
</zipUpload>
It contains the id’s of the media types that will be used and the file extensions that will be considered as image.
In case it doesn’t show up on the dashboard this is the snipped that needs to be inserted in the /config/dashboard.config file:
<section>
<areas>
<area>media</area>
</areas>
<tab caption=”Zip Upload”>
<control>/usercontrols/zipupload.ascx</control>
</tab>
</section>
Credits to the original developer of umbdashboard (think it was Niels), I only did some small modifications.
Zip Upload Package: download

Tim YOU ROCK! thx for taking it under your wing to update some of these valuable additions to umbraco!
Hi Tim,
great feature. Maybe it can be enabled by default in V4.
Only one suggestion - add option not to add zip name to media section.
Thank you
Petr
Tim,
Just downloaded the package but it does not seem to have the dll’s?
Regards
Ismail
@Ismail, just downloaded the package and extracted the archive .. Dll is in place.
Hi Tim
VERY nice tool…
I’m just about to upload 8000 images from a Sitecore site to a new site in Umbraco 4. Before the big run, I made a simple test with 20 images. I works fine but it doesn’t create thumbnails or generate the width/height properties…? If your tool could do that, it would REALLY make my day…
Regards
Ulrich
@Ulrich, it should do that, what is the extension of your images ?
@Ulrich indeed, was a small bug, is fixed now.
For thumbnails,
Add this
<thumbnailSizes>200;500</thumbnailSizes>
To the config file (between <zipUpload>)
Hi Tim,
All images are .jpg. Also, in IE there is a couple of javascript errors not present in Firefox.
Hmm… i’ll try an upload from Firefox…
/ulrich
@Ulrich, just download the new version, unpack and copy the assembly to your application
Tim,
Downloaded again and all works nicely. many thanks bringing this gem to life for umbraco v4.
Hi Tim,
I works almost perfect now… When an image with a filesize of several megebytes is uploaded, it’s treated like a file instead of an image. If you have a treshold value in your code, could that be set in the config file instead? Is that possible?
Most of our images are between 2 and 10 mb of size - I’m building some custom functionality that serverside resizes the images based on some rules defined for each document type and where it’s used. That way we can control the appearence of images all over the site… and all instances of an image are based on one source image.
I’ll send the module back to the community when it’s done..
will this work in 3.6?
Thanks for giving this TLC. Let’s get it in the package repository!
I am also interested if this would work on 3.0.6. If not does it have an alternative?
@Martin, I’ll post the sourcecode. It should be easy to make this work with v3 (just reference those assembly’s instead of the v4 ones).
You can download the sourcecode here: http://www.nibble.be/temp/Nibble.Umb.ZipUpload.zip
Hi Tim,
I’m gabriele. Yuor blog is very interesting and is full of data for umbraco. Now i’ve a big problem. I have to upload 200 pdf files to the media section. I think your control is perfetct for me.
But i don’t understand how to trasform the package for the 3.0.2 version…
OT: i take the simple video player of Bob baty barr. I’d like change this package to works with silverlight instead flash. Can you help me?
Thanks
Gabriele
hey some news?
Just a quick note. The file extensions are case sensitive. JPG don’t work, but jpg works. Easy to add to zipupload.config. A heads up for everyone.
Thanks for a great package, Tim!
Regards
Max
@Max, did an update this week, file extensions should be case insensitive now.
Perfect!!
//Max
Hmmmm. I get an error when I try to upload a zip file:
Server Error in ‘/’ Application.
Object reference not set to an instance of an object.
[NullReferenceException: Object reference not set to an instance of an object.]
Nibble.Umb.ZipUpload.zipupload.Button1_Click(Object sender, EventArgs e) 3811
System.Web.UI.WebControls.Button.OnClick(EventArgs e) 105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) 107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) 7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) 11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) 33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfte
Is the package install the most recent version? Or do I need to compile the source code?
Commenting out:
newMedia.getProperty(”umbracoExtension”).Value = Path.GetExtension(theEntry.Name).Replace(”.”, “”);
and recompliling fixed the problem.
Not sure why this is generating a null reference exception for me.
Thanks Tim,
With the source it worked. I would suggest including the csharpzip library because you have a reference to a specific version.
Thanks for the great work!
Martin
Hi and thanks for the great modification.
It seems that works fine however since I’ve unistalled it I ‘ve got some erros when clicking on any of my media folders.
I already remove the addition code from the /config/dashboard.config file and I am getting this error
——-
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
——–
any ideas?
Cheers,
Gio
Hi Ben,
How did you solve the problem with the Object reference not set to an instance of an object? Is the code you change in the source, and what does the code exactly do in the zipUpload?
Kind regards,
Niels
Hi Tim
Nice tool, just what I was looking for!
But at the codeplex project “umbraco Extension”, I can’t find your Zip Upload package, only AutoForm Plus, Doc2Form, etc. Has it been moved to another location ?
Cheers,
Anders
Hi Tim
Never mind my previous comment yesterday. Just found your download link at the bottom of the blog post.
/Anders
I got the upload to work from the source with the change comittet i post above . But to enable see the nodes on the frontend i need to touch every single node. Takes a bit when uploading 50 images. Any fixed for this issue ?
Oh and there is a typo in umbraco v4 under media/image template it says
umbracoExtensio
and not
umbracoExtension
put in the extra end in the media template and the change made in this log is not needed. Still got the other issue though that one have to tuoch every single image before you can iterate over the media folder containing the images.
still lookin for fix for that..
Thank you very much, I saved a lots of hours with your package !!!
I just change umbracoExtension to umbracoExtensio and it work fine for me for v4.0.1..
Hi,
This may be easy for experienced users, but I’m a mere novice (have used Umbraco for two days). I’m trying to get Runway Media to work and this could solve my problems (maybe).
At the top of this post it says “Once it’s installed….” Yes, but how? It doesn’t say anything about how to install and I’m totally lost. Could anyone please enligthen me on how to install this great functionality?
Regards
Carsten
@Ulrich,
you searched for an example to set the height and width for an image uploaded..
I used this piece of code to find these image properties
//Determine type and filename of uploaded image
string UploadedImageType = UploadedPicture.PostedFile.ContentType.ToString().ToLower();
string UploadedImageFileName = UploadedPicture.PostedFile.FileName;
//Create an image object from the uploaded file
System.Drawing.Image UploadedImage = System.Drawing.Image.FromStream(UploadedPicture.PostedFile.InputStream);
//Determine width and height of uploaded image
float UploadedImageWidth = UploadedImage.PhysicalDimension.Width;
float UploadedImageHeight = UploadedImage.PhysicalDimension.Height;
Great package!
Superb package, saves a lot of time for me! Thanks!
Hi,
I have a site with Umbraco 4.0.2.1 installed on it and I’ve installed the ZIP Upload package.
When I want to upload a zip, with only pdf files (no folders), it gets the following error:
Server Error in ‘/’ Application.
Wrong Local header signature: 0×21726152
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: ICSharpCode.SharpZipLib.Zip.ZipException: Wrong Local header signature: 0×21726152
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ZipException: Wrong Local header signature: 0×21726152]
ICSharpCode.SharpZipLib.Zip.ZipInputStream.GetNextEntry() 1166
Nibble.Umb.ZipUpload.zipupload.Button1_Click(Object sender, EventArgs e) 7011
System.Web.UI.WebControls.Button.OnClick(EventArgs e) 111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) 110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) 10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) 13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) 36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 1565
Do you have any idea why it happens?
Thanx,
Sander
Hi,
Your package is very useful.
It would be nice, if one could create a folder uploading the zip without having it inside the compressed file.
For example, if you upload product pictures in batches, it would be very helpful to have all those product batches in different folders.
It’s possible to do so even now, but one has to pre-create the folders before the upload. Do you plan any behavior like this?
Best regards,
Arpicheck
Hi Tim,
First of all, congratulations. You’re doing a really great job.
While testing your zip package, I’ve had this error :
————————————————
Server Error in ‘/’ Application.
Maximum request length exceeded.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Maximum request length exceeded.
————————————————
The zip file weight is a bit more than 6 Mo.
Is there any file size restriction ?
Thanks,
Didier
Hi Tim,
Sorry, I found the solution.
It’s just the httpruntime key in the web.config file (system.web node).
Default is 4 MB.
To set it to 50 MB for exemple :
Hi Tim,
I updated the Zip Upload for Umbraco Version 4.5. Was just an update of the refernces. I could not find the project on codeplex. You can download the source files from http://personal.idseefeld.de/umb/Nibble.Umb.ZipUpload_v4.zip. Solution is upgraded to VS 2010.
Yours Dirk