Clear Upload control

4 posts, 0 answers
  1. Dekel
    Dekel avatar
    25 posts
    Member since:
    Jan 2015

    Posted 08 Jul 2015 Link to this post

    Hello,

     

    I'm using Kendo for MVC.

    How do I clear the value of the upload control so it won't send the previously selected file?

     

    Thanks

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 08 Jul 2015 Link to this post

    Hello Dekel,

    Could you elaborate when exactly would you like to clear the selected files in the Upload widget?

    I am looking forward to hearing from you.

    Regards,
    Dimiter Madjarov
    Telerik
     
    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. Dekel
    Dekel avatar
    25 posts
    Member since:
    Jan 2015

    Posted 30 Jul 2015 in reply to Dimiter Madjarov Link to this post

    When the user selects a file to upload using the kendo upload control, it shows it under the control.

    The upload control I'm using is needed only if a certian flag is on so sometimes I hide it.

    If the users chooses an option that requires a file upload then it is shown. 

     

    What happens is, that if the user chooses a file and then changes the option to a one without an upload, the file will be sent to the server non the less.

    Even if I clear the value of the input and remove all the elements like suggested in a google search that I did.

    I want to clear the upload control when it is hidden.

    Thank you

  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 31 Jul 2015 Link to this post

    Hello Dekel,

    There is no API method for clearing the files in the Upload. You would have to iterate the files in the list and manually trigger the click of their remove button.

    Regards,
    Dimiter Madjarov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready