Prevent folder uploading

2 posts, 0 answers
  1. Hans
    Hans avatar
    28 posts
    Member since:
    Mar 2011

    Posted 04 Oct 2013 Link to this post

    Hi, I have issue with folder uploading.
    My scenario is:
    - user drag and drop folder on Kendo uploader;
    - in method upload for Kendo uploader I check if file have't extension and it's file size is 0;
    - if yes I cancel uploading using such code:
                                                                                     return false;
    - if no continue file uploading

    But for some folders I have situation when it's size is not 0.

    How I can correctly prevent folder uploading using Kendo Uploader.

    I check this in Chrome browser version Version 29.0.1547.76 m.

    My code is:
    upload: function (e) {
                        $.each(e.files, function (index, el)

                            //If we try to upload folder prevent this
                            if (el.extension === "" && (typeof el.size === "undefined" || el.size === 0)) {
                                return false;

  2. Dimiter Madjarov
    Dimiter Madjarov avatar
    2123 posts

    Posted 07 Oct 2013 Link to this post

    Hi Hans,

    Detecting if the uploaded item is a folder or a file is not reliable on the client side. It is recommendable to do this on the server side. Here is a forum topic, which discusses the topic further.

    Dimiter Madjarov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top