New to Telerik UI for ASP.NET Core? Start a free 30-day trial
Copy and Paste Files in the Upload
Environment
Product | Telerik UI for ASP.NET Core Upload |
Progress Telerik UI for ASP.NET Core version | Created with the 2022.2.802 version |
Description
How can I copy and paste a file into the Telerik UI for ASP.NET Core Upload?
Solution
- Create a paste container and decorate it with the
contenteditable
HTML attribute. - To paste a copied file, handle the
paste
event of the container. - To insert the newly pasted file, use the
DataTransfer
object within the handler.
Index.cshtml
@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.Save("Async_Save", "Upload")
.Remove("Async_Remove", "Upload")
.AutoUpload(false)
)
)
<div class="paste-area" contenteditable="true">
Paste Area
</div>
For the complete implementation of the suggested approach, refer to the following Telerik REPL example.