restrict file types

Thread is closed for posting
9 posts, 0 answers
  1. John Crumpton
    John Crumpton avatar
    12 posts
    Member since:
    Jul 2009

    Posted 15 Sep 2011 Link to this post

    is it possible to restrict the upload to only certain file types?
    i am already validating that in the handler... but would prefer to just prevent the user from selecting an invalid file type.
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 16 Sep 2011 Link to this post

    Hi John,

    You can use the OnSelect client-side event to prevent the selection of files with invalid extensions. The handler validation is still required.

    Note that you have to cancel the selection of all files if more than one is chosen at one go.

    Greetings,
    Tsvetomir Tsonev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Q
    Q avatar
    3 posts
    Member since:
    Dec 2011

    Posted 06 Dec 2011 Link to this post

    Is there anyway to do this via the kendo.upload.js?
  5. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 06 Dec 2011 Link to this post

    Hi,

    Oops, wrong link, sorry! Try this one.

    Regards,
    Tsvetomir Tsonev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Q
    Q avatar
    3 posts
    Member since:
    Dec 2011

    Posted 06 Dec 2011 Link to this post

    nice, that covers part of it.  what about on the drag over, is there anyway to detect the file extension?
  7. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 07 Dec 2011 Link to this post

    Hi,

    The select event will fire when you drop files as well. Same code applies without change.

    All the best,
    Tsvetomir Tsonev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  8. Q
    Q avatar
    3 posts
    Member since:
    Dec 2011

    Posted 07 Dec 2011 Link to this post

    Yes, on drop it works, but what about on drag over?
  9. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 07 Dec 2011 Link to this post

    Hello,

    I did a quick test in Chrome. the list of dragged files is not available in the dragover and dragenter DOM events. It is populated only when the actual drop occurs.

    In short, we don't know what's being dragged until it's dropped.

    Kind regards,
    Tsvetomir Tsonev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  10. Manuel
    Manuel avatar
    1 posts
    Member since:
    May 2012

    Posted 17 May 2012 Link to this post

    hi

    i have a problem uploading files, i mean any extension, i dont know if kendo upload support all file extensions.

    thanks
Back to Top
Kendo UI is VS 2017 Ready