File Type

7 posts, 0 answers
  1. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 17 Sep 2012 Link to this post

    Is there a way to restrict the file types that can be uploaded? Say to only images.
  2. Nohinn
    Nohinn avatar
    167 posts
    Member since:
    Feb 2011

    Posted 17 Sep 2012 Link to this post

    Here you have a sample that restricts the uploads to be of jpg extension
    http://jsbin.com/upekan/1/edit 
  3. Kendo UI is VS 2017 Ready
  4. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 21 Sep 2012 Link to this post

    Thanks Nohinn,

    To you know if there is a way to send some sort of filtering info to the browser so that when the user selects the file they see only images?
  5. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010
  6. JoJo
    JoJo avatar
    20 posts
    Member since:
    Dec 2012

    Posted 21 Dec 2012 Link to this post

    Hi, 

    The code in the above link will not select the file if the file is not in the required format.

    I have a scenario, where the the user can select multiple different file types from the File Upload Dialog and on OnSelect event ( or any other appropriate event ) i want to discard the unsupported files from the list of select files so i can upload only the files with supported formats to the server. 

    Multiple is set to True.

    e.preventDefault(); - This is causing the entire file list to empty when the file list contains atleast one
    unsupported file format.

    Else if we can restrict the supported file types from the File Upload Dialog itself that would be awesome.

    How do we do this ? Let me know your inputs.
  7. JoJo
    JoJo avatar
    20 posts
    Member since:
    Dec 2012

    Posted 28 Dec 2012 Link to this post

    Hi Kendo Team, 

    Any help on the following issue.

    I have tried to remove the unsupported files from the list (e.files) in the event "OnSelect" event but it didn't worked.
  8. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 29 Dec 2012 Link to this post

    Hello,

    As per my knowledge I think we are not able to do this thing.

    Thanks,
    Jayesh Goyani
Back to Top
Kendo UI is VS 2017 Ready