Nibble

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.

zipupload

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.

zipuploadfinished

If you refresh the media tree, files and folders should be in place

zipuploadmedia

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

51 Comments so far

  1. bob baty-barr on January 16th, 2009

    Tim YOU ROCK! thx for taking it under your wing to update some of these valuable additions to umbraco!

  2. Petr Snobelt on January 16th, 2009

    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

  3. Ismail on January 19th, 2009

    Tim,

    Just downloaded the package but it does not seem to have the dll’s?

    Regards

    Ismail

  4. Tim Geyssens on January 19th, 2009

    @Ismail, just downloaded the package and extracted the archive .. Dll is in place.

  5. Ulrich Ebsen on January 19th, 2009

    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

  6. Tim Geyssens on January 19th, 2009

    @Ulrich, it should do that, what is the extension of your images ?

  7. Tim Geyssens on January 19th, 2009

    @Ulrich indeed, was a small bug, is fixed now.

    For thumbnails,

    Add this

    <thumbnailSizes>200;500</thumbnailSizes>

    To the config file (between <zipUpload>)

  8. Ulrich Ebsen on January 19th, 2009

    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

  9. Tim Geyssens on January 19th, 2009

    @Ulrich, just download the new version, unpack and copy the assembly to your application

  10. Ismail on January 19th, 2009

    Tim,

    Downloaded again and all works nicely. many thanks bringing this gem to life for umbraco v4.

  11. Ulrich Ebsen on January 20th, 2009

    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.. ;)

  12. claus on January 21st, 2009

    will this work in 3.6?

  13. Hartvig on January 23rd, 2009

    Thanks for giving this TLC. Let’s get it in the package repository!

  14. Martin on January 28th, 2009

    I am also interested if this would work on 3.0.6. If not does it have an alternative?

  15. Tim Geyssens on January 28th, 2009

    @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).

  16. Tim Geyssens on January 30th, 2009

    You can download the sourcecode here: http://www.nibble.be/temp/Nibble.Umb.ZipUpload.zip

  17. Gabriele on February 3rd, 2009

    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

  18. Gabriele on February 9th, 2009

    hey some news?

  19. Max Eriksson on February 13th, 2009

    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

  20. Tim Geyssens on February 13th, 2009

    @Max, did an update this week, file extensions should be case insensitive now.

  21. Max Eriksson on February 15th, 2009

    Perfect!!

    //Max

  22. Ben on February 18th, 2009

    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?

  23. Ben on February 19th, 2009

    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.

  24. Martin on February 20th, 2009

    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

  25. Giorgos on March 1st, 2009

    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

  26. Niels Kristiansen on March 3rd, 2009

    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

  27. Anders Tollestrup on March 23rd, 2009

    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

  28. Anders Tollestrup on March 24th, 2009

    Hi Tim

    Never mind my previous comment yesterday. Just found your download link at the bottom of the blog post.

    /Anders

  29. Thomas on March 24th, 2009

    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 ?

  30. Thomas on March 24th, 2009

    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..

  31. Antoine on March 31st, 2009

    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..

  32. Carsten on April 8th, 2009

    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

  33. Mario Allegro on June 17th, 2009

    @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;

  34. Stefan Kip on December 30th, 2009

    Great package!

  35. Martijn Veken on March 14th, 2010

    Superb package, saves a lot of time for me! Thanks!

  36. Sander on April 15th, 2010

    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

  37. Arpicheck on May 5th, 2010

    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

  38. Didier on May 14th, 2010

    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

  39. Didier on May 14th, 2010

    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 :

  40. Dirk Seefeld on July 21st, 2010

    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

  41. Javier on November 1st, 2010

    Hi Tim,
    Finally a control that works!!!!!!!!!!! Thanks a lot!!!! :)

  42. tim on December 26th, 2011

    Hi Dirk,

    The link to the 4.5 updated version seems to be broken.

    Would you be kind enough to provide a link that i can download the updated version?

    thanks in advance.
    merry xmas!

  43. Matthias Daun on January 26th, 2012

    Hi,

    i updated the package for Umbraco 4.7.1 (includes an update of the ICSharpCode.SharpZipLib.dll reference and a slightly trimmed-down css. You can download the package from http://downloads.digital-bauhaus.de/umbraco/Nibble.Umb.Zipupload_1.0.zip

    HTH
    Matthias

  44. Matthias Daun on January 26th, 2012

    …and just discovered an additional config option:
    250;450

    very nice.

  45. Matthias Daun on January 26th, 2012

    sorry the code has been stripped in my former comment:

    thumbnailSizes 250;450 /thumbnailSizes

  46. alprazolam on February 11th, 2012

    This info is priceless. When can I find out more?

  47. hetal on March 2nd, 2012

    hey its not working in 4.7.1.1… 500 internal server error message comes

  48. Matthias Daun on May 3rd, 2012

    @hetal: do you refer to the original version or my updated version (see some comments above)?

  49. click now on May 23rd, 2012

    Valuable info. Fortunate me I found your site by chance,
    and I am surprised why this coincidence didn’t happened earlier! I bookmarked it.

  50. Jamez Jay on April 2nd, 2013

    Hey Tim,

    I just loaded this onto a v4.11.3.1 site and it gives me “Could not load file or assembly ‘ICSharpCode.SharpZipLib, Version=0.85.4.369, Culture=neutral, PublicKeyToken=1b03e6acf1164f73′ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0×80131040)”

    It appears the package does not contain SharpZipLib but the default version for v4.11.3.1 doesn’t match what you’re looking for. In my bin, I see iCSharpCode.SharpZipLib as v0.86.0.518.

    Can you help?

  51. Carte PSN gratuite on April 26th, 2014

    It’s hard to come by well-informed people on
    this topic, but you seem like you know what
    you’re talking about! Thanks

    My web page Carte PSN gratuite

Leave a Reply