Chunk Upload does not work well on protocol http/2

1 Answer 210 Views
Upload
DaN
Top achievements
Rank 1
DaN asked on 30 Sep 2022, 06:19 AM

If I upload a 1GB file using http/1.1 protocol everything works fine. But if I switch my IIS web site to http/2.0 and upload it again, I often get a "Failed to upload files" message. Both scenarios attached.

Environments:

  • Firefox 105.0.1 (64-bit)
  • Windows 10
  • local IIS 10.0
  • Telerik UI for ASP.NET Core R3 2022, Assembly Kendo.Mvc, Version=2022.3.913.0 trial

I would like to prefer the latest http protocol in my application.

 

 

 

1 Answer, 1 is accepted

Sort by
0
Momchil
Telerik team
answered on 04 Oct 2022, 02:48 PM

Hello Daniel,

Thank you for providing screen recordings of the issue.

Here are a couple of suggestions:

1) The Upload provides some built-in configuration options which can be used to modify the Chunk Upload. The following documentation article describes them.

Could you try enabling the automatic retry to see if that solves the issue?

@(Html.Kendo().Upload()
        .Name("files")
        .Async(a => a
            ...
            .AutoRetryAfter(300) // Will attempt a failed chunk upload after 300ms.
            .MaxAutoRetries(4) // Will attempt the same failed chunk upload 4 times.
        )
    )

2) If the problem is exclusive to large files only, maybe the maximum request size is being exceeded and that is the reason an error is thrown. The following GitHub issue provides a possible solution for the aforementioned problem.

 

However, if none of the suggestions help resolve the issue, could you consider creating a Fiddler Jam Log and sending it to me, as it provides valuable information such as Network logs, errors, etc which can be of great help in troubleshooting the issue?

Additionally, information about how HTTP/2.0 is configured and a runnable sample where the issue is reproducible would also be beneficial in any further investigation.

I hope you find this information useful. Looking forward to hearing back from you.

 

Kind Regards,
Momchil
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/.

DaN
Top achievements
Rank 1
commented on 12 Oct 2022, 12:14 PM | edited

Hi, thanks for the reply.

The recovery logic helps a lot, but I'm afraid it's still not enough. After a few stumbles during the upload, it sometimes happens that the file is different on the client  and the server side after the upload is complete. How is data integrity guaranteed?

I am only using your demo application downloaded from https://www.telerik.com/aspnet-core-ui (ChunkUpload.cshtml, Chunk_Upload_Save handler in ChunkUploadController.cs) asi is. I either run it directly from Visual Studio on IISExpress or from local IIS. I don't do any special app configuration or http configuration. Everything works with default settings.
Mihaela
Telerik team
commented on 17 Oct 2022, 09:39 AM

Hello Daniel,

Thank you for your feedback.

To ensure that the uploaded file is the same as the one that was being uploaded on the server, you could do the following:

  1. Subscribe to the "select" event of the Upload and get the file size.
  2. Handle the "success" event that will trigger when the upload operation is completed successfully and compare the uploaded file size with the initial file size.

 

@(Html.Kendo().Upload()
        .Name("files")
        ...
        .Events(ev => ev.Select("onSelect").Success("onSuccess"))
    )

<script>
    var initialFileSize = 0;

    function onSelect(e) {
        initialFileSize = e.files[0].size;
    }

    function onSuccess(e) {
        let uplaodedFileSize = e.files[0].size;
        if(uplaodedFileSize != initialFileSize) {
            e.preventDefault();
            alert("not the same");
        }
    }
</script>

Also, I have tested the attached runnable sample locally (with Local IIS and HTTP/2 protocol), and it seems to be working fine. Since the issue appears when uploading a large file only, I would suggest increasing the default request limit (maxAllowedContentLength) in the web.config file and the MaxRequestBodySize in the Program.cs file, as described in this GitHub issue.

Let me know if the issue is resolved at your end.

 

Tags
Upload
Asked by
DaN
Top achievements
Rank 1
Answers by
Momchil
Telerik team
Share this question
or