2024.1.130 Kendo Upload Control Async Not Working on "Select File"

1 Answer 30 Views
Upload
Will
Top achievements
Rank 1
Will asked on 18 Mar 2024, 03:32 PM

Hello Telerik,

I am using the Kendo Upload Control with Async AutoUpload set to "true".  In version 2023.3.1114, when using "Select File" to upload a document the control works perfectly.  Dragging and dropping a file onto the control also works perfectly. 

After upgrading to 2024.1.130 using "Select File" to upload a document does not work, but dragging and dropping a file does work to upload a document.

Can you please advise me as to what I am doing wrong.  I am using jQuery v3.7.0.

My client side code looks like the following:
@(Html.Kendo().Upload()
		.Name("uplCtrl")
		.HtmlAttributes(new { aria_label = "files", title = "Select file to upload" })
		.Multiple(false)
		.Messages(m => m.Select("Select file...")
		.DropFilesHere("Drop file here to upload"))
		.ShowFileList(false)
		.Async(a => a
			.Save("UploadSave", "Vendors")
			.AutoUpload(true)                                        
		)
		.Validation(validation =>
		{
			validation.AllowedExtensions(new string[] { "pdf", "docx", "xlsx", "zip" });
			validation.MaxFileSize(52428800);
		})
		.Events(e => e
			.Error("onUploadError")
			.Complete("onUploadSuccess")
			.Upload("onUpload")
		)
	)

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivan Danchev
Telerik team
answered on 21 Mar 2024, 01:48 PM

Hello Will,

The UploadSave action has not been posted and a common mistake is not using the actual name of the Upload (in your case uplCrtl) in the action to access the uploaded file.

I've attached a sample project in which there is an Upload with the same configuration as yours. I was able to successfully upload a file with an allowed extension (e.g., .pdf) through the "Select File..." button. Since this option is disabled:

ShowFileList(false)

the upload progress is not displayed by the component, so I've verified this by placing a break point in the UploadSave action.

Let us know in case we are missing something with regard to reproducing the problematic behavior.

Regards,
Ivan Danchev
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
Will
Top achievements
Rank 1
commented on 21 Mar 2024, 03:43 PM | edited

Hi Ivan,

Thank you for this solution.  We were using the following:

public async Task<ActionResult> UploadSave([FromForm(Name = "uplCtrl")] IFormFile file)

 

Using this instead has resolved our issue:

public async Task<ActionResult> UploadSave(IFormFile uplCtrl)

Best,

W

Tags
Upload
Asked by
Will
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or