This is a migrated thread and some comments may be shown as answers.

Clear Upload control

3 Answers 65 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Dekel
Top achievements
Rank 1
Dekel asked on 08 Jul 2015, 07:34 AM

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

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 08 Jul 2015, 08:14 AM

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!
 
0
Dekel
Top achievements
Rank 1
answered on 30 Jul 2015, 06:42 AM

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

0
Dimiter Madjarov
Telerik team
answered on 31 Jul 2015, 08:43 AM

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!
 
Tags
Upload
Asked by
Dekel
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Dekel
Top achievements
Rank 1
Share this question
or