8 Answers, 1 is accepted
Hello,
If the reason you're asking is because retrying does not fire OnUpload again, you can Follow a fix for that here. I've also added there a bit of CSS that you can use to hide the retry button.
Regards,
Marin Bratanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Well, in my situation I have defined filetype restictions, which seems to fire client-side validation but I also do server-side checks on the file before saving the file to its destination, and if those checks fail I return a BadRequestObjectResult and use an error handler.
So maybe the best way to deal with this is to either do all the checks server-side, but when the error happens I am just showing an alert via a modal window component. How could I turn off / hide the file "history" that shows up after an upload?
Hello,
There are two feature requests for something similar to that - please check them and see which is the one you need so you can Vote for it and Follow it:
- removing all files in the current list: https://feedback.telerik.com/blazor/1485661-clear-current-files-in-blazor-upload
- being able to add files yourself to the list even without the user uploading them: https://feedback.telerik.com/blazor/1485660-initial-files-in-blazor-upload
From what I understand, the file would never be able to be valid in your case, so re-uploading would not make sense and thus hiding the Retry button with CSS should work. It would, perhaps be nice if you could remove it and keep the list of successful ones, which would be possible after both features above are implemented.
If this is not what you seek, could you provide some more details on what functionality you would want from the component? It is important to consider that the Retry button may be meaningful if some metadata on the file can change (which is something you collect through OnUpload), or there was a network issue.
Regards,
Marin Bratanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
In the UI, after an upload there is a <ul> element with class = "k-upload-files k-reset" that I guess I could just set visibility = none?
I think its this option that would better fit what I am trying to do
Hello,
You could use CSS to hide the list, there is no issue with that. You could wrap the upload in a <div> whose class you can set dynamically based on a flag you raise in OnSuccess or OnError, in order to cascade through it and hide the list conditionally, if you don't want to hide it all the time.
Regards,
Marin Bratanov
Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).
Hi,
The following blog post can help you inspect the HTML rendering and classes in order to devise the rule you need for the outcome you want: https://www.telerik.com/blogs/improve-your-debugging-skills-with-chrome-devtools
Regards,
Marin Bratanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.