Telerik Forums
UI for ASP.NET Core Forum
1 answer
27 views

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")
		)
	)

Ivan Danchev
Telerik team
 answered on 21 Mar 2024
1 answer
50 views

Razor code-behind method: I made the razor method as simple as possible, just to see if we could get in there / or hit onpostUploadFile
        public async Task<ActionResult> OnPostUploadFile(IEnumerable<IFormFile> files, string metaData)
        {
            AllowedExtensions = new string[] { "fpd", "pdf" };

            return Page();
        }

Razor page :

@addTagHelper *, Kendo.Mvc
<div>
    <div class="demo-section">
        <kendo-upload name="files">
            <async auto-upload="true" save-url="@Url.Action("Upload","UploadFile")" chunk-size="11000" />
            <validation max-file-size="20000000" />
        </kendo-upload>
    </div>
</div>

The issue is i am not able to hit the hander from the razor page when i pass the url to <async save-url="">, Despite many efforts, the handler specified in the save-url attribute doesn't seem to be hit and returns 404.

Not Working: 

1. save-url: "/Upload/UploadFile",

2. save-url="./Upload?handler=UploadFile"

I also found Forum where it discussed the same problem but that didn't help us :https://www.telerik.com/forums/upload-using-tag-helpers

 

Mihaela
Telerik team
 answered on 17 Jan 2024
1 answer
105 views

Hello!

I am trying to add a <kendo-upload> tag onto the toolbar of a kendo grid using TagHelper and ASP.NET Core

Though I am struggling with figuring out how to do this,  I have followed this template: https://demos.telerik.com/aspnet-core/grid/toolbar-template to not much success. 

My goal is to simply add a file upload option to upload an excel file to populate the fields of a grid!

Any ideas on how to progress?

Thank you!

But I am still struggling

Mihaela
Telerik team
 answered on 08 Dec 2023
1 answer
249 views

Hello,

 

where can I find the controller code for ASP.NET Core Upload Asynchronous Upload. Somehow when I trying to upload my file, I keep getting an error "failed to upload the file". below is what i have in my controller:

 


  public ActionResult Async_Save(IEnumerable<IFormFile> files)
        {
            // The Name of the Upload component is "files"
            string path = Path.Combine(_webHostEnvironment.WebRootPath, "FileSavePath");
            string DestinationPath = _configuration["DestinationPath"].ToString();
            if (files != null)
            {
                MoveFiles mf = new MoveFiles(); 
               
                foreach (var formFile in files)
                {
                    
                  

                    using (var stream = System.IO.File.Create(DestinationPath))
                    {
                        formFile.CopyTo(stream);
                    }

                    
                }
            }

This is my cshtml code:

 

any help will be apprecaited.
@using Kendo.Mvc.UI
<div style="margin-top:60px">
        <div class="block-section">
        @(Html.Kendo().Upload()
            .Name("files")
            .Async(a => a
                .Save("Async_Save", "Upload")
                .Remove("Async_Remove", "Upload")
                .AutoUpload(true)
            )
        )
    </div>
</div>

Vasko
Telerik team
 answered on 21 Aug 2023
1 answer
204 views
We are using Telerik for Asp.Net Core.  Using the file upload control in asynchronous chunk mode is there a maximum file size?  I know in synchronous mode its about 2gb, but I am curious if using chunk mode we can go past that since the file is uploaded in pieces.?
Vasko
Telerik team
 answered on 21 Aug 2023
1 answer
362 views
I have uploaded .wav audio file using kendo upload and i have the blob path and url, that the file is saved to.
Now do we have a control that helps us play audio file that is uploaded. like we have this
https://demos.telerik.com/aspnet-core/mediaplayer/events
Stoyan
Telerik team
 answered on 19 Jul 2023
1 answer
88 views

Good afternoon,

I'm using a chunk upload to upload files, some of which could be greater than 2GB.

When the user has selected a file I want to run a series of checks of the filename against a database before deciding whether to allow the upload to take place.  If it fails that validation I want it to return a message to the view explaining why it failed.

I've set the Upload as follows:

        @(Html.Kendo().Upload()
            .Name("files")
            .HtmlAttributes(new { aria_label = "files"})
            .Enable(true)
            .Multiple(false)
            .Async(a => a
                .Save("Async_ChunkSave", "Source")
                .Remove("Async_Remove", "Source")
                .AutoUpload(true)
                .ChunkSize(4194304)
            )
            .Events(events => events
                .Upload("onUpload")
                .Complete("onComplete")
                .Error("onUploadError"))
        )

I'm using the Upload event to send some extra data from the view:

public async Task<ActionResult> Async_ChunkSaveAsync(IEnumerable<IFormFile> files, string metaData, string uploadData)

Am I right in thinking that although it has a foreach file in files, it will only be one file since chunkData.FileName can only be one file - presumably the same name as the file's.

                    if (files != null)
                    {
                        foreach (var file in files)
                        {
                            path = Path.Combine(fullFolderPath, chunkData.FileName);
                            AppendToFile(path, file);
                        }
                    }

Where is the best place to validate the filename against the database, before it starts handling some potentially very large files? And then return an appropriate error message to the View, and halt the upload?

Kind regards,

Richard

 

Mihaela
Telerik team
 answered on 28 Jun 2023
2 answers
246 views
HI,
how can i add a file upload (image) in a kendo form?

I don't see item upload in the list (see image)

Thank you


n/a
Top achievements
Rank 1
Iron
 answered on 06 Mar 2023
1 answer
303 views

Hi, 

I'm working on develop web application using MVC Core with Razor. I'm using kendo upload to upload excel file.  After I got the uploaded excel file, I want to read the data to the temp table (or grid if possible). How do I get to the Posted File InputSteam to read  or loop data to temp table? With asp.net web form, I used PostedFile.InputSteam to read data, how do I do that with kendo upload control?

Thank you for your help.

 

Mihaela
Telerik team
 answered on 24 Feb 2023
1 answer
177 views

Model:

 public string TemplateId { get; set; } 
 public byte[] Template { get; set; }
 public string? Filter { get; set; }
 public DateTime ValidFrom { get; set; }

I have Implemented a Grid with a popup editor.

The Template field is used to store the file as Blob in the DB.

In the add row there should be a File upload and in the edit also need a file upload.

I have created a custom template for add row, but the file is not post back to controller.

How can we send the file and the form data in the request to controller?

Stoyan
Telerik team
 answered on 31 Jan 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?