Upload - IEnumerable<HttpPostedFileBase> images null on tablets for multiple images

1 Answer 181 Views
Upload
Stefan
Top achievements
Rank 1
Iron
Iron
Iron
Stefan asked on 06 Jan 2023, 02:08 PM

HI,

we're using the Upload control like this:

Client:

@(Html.Kendo().Upload()
        .Name("images")
        .Async(a => a
            .Save("SaveImages", "Box")
            .Batch(false)
            .AutoUpload(true)
        )
        .HtmlAttributes(new { accept = "image/*" })
        .Events(e => {
            e.Upload("upload");
            e.Remove("remove");
        })
        .DropZone(".dropZoneElement")
        .ShowFileList(false)
        .Validation(v => v.AllowedExtensions(new string[] { ".jpg", ".jpeg", ".png", ".bmp", ".gif" }))
    )
// https://docs.telerik.com/kendo-ui/knowledge-base/upload-mvc-send-additional-data
        function upload(e) {
            e.data = {
                id: @Model.ID
            };
        }

        function remove(e) {
            e.data = {
                id: @Model.ID
            };
        }

Server:


public ActionResult SaveImages(IEnumerable<HttpPostedFileBase> images, int id)
        {
            var ids = new Dictionary<string, int>();

            if(id > 0)
            {
                foreach (var image in images)
                {
                    ...
                }
            }
            
            return Json(ids);
        }

A customer of ours now has the problem, that when uploading multiple images the images-Parameter on server-side is null. Uploading single images is working. The problem is only occuring on tablets.

We currently cannot reproduce this behaviour. Is there anything we must know here which can lead to this behaviour?

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 11 Jan 2023, 12:15 PM

Hi Stefan,

The posted configuration of the Upload is ok and it is similar to the one in this demo: https://demos.telerik.com/aspnet-mvc/upload/customdropzone

Currently, we have no known issue related to uploading multiple images with mobile devices, but nevertheless using the latest official version is recommended.

I would suggest testing the scenario and verifying whether it is related to using a specific device. If so, please provide more details on:

  • the type of the device and the version of its operating system
  • the amount of files that are selected at once
  • the size of the files and whether the issue is exhibited when you attempt to upload them by dropping them over a dropzone, or through the Upload's "Select" button. 

 

Regards,
Ivan Danchev
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/.

Stefan
Top achievements
Rank 1
Iron
Iron
Iron
commented on 13 Jan 2023, 03:17 PM

We're currently using 2022.2.510, so fairly new, but might upgrade if the problem persists. (Upgrading is a bit of a time consuming process, so we do it irregularily...)

As for the the testing scenario we have to rely on our customer's information, as we were not able to reproduce it ourselves.

  • type/device: Samsung Galaxy Tab A8 SM-X200 (Android 13 (OneUI5), Chrome Browser 108.0.5359.128), Samsung Galaxy Tab Active Pro SM-T545 (Android 11 (OneUI3.1), Chrome Browser 108.0.5359.128)
  • amount of files: 3-5
  • size of files: 2-3 MB each, unknown if uploaded via dropzone or 'Select'
Ivan Danchev
Telerik team
commented on 18 Jan 2023, 02:56 PM

Stefan,

We tested the mobile devices and we were unable to reproduce the issue. The requests that the Upload sent to the server contained the file data. We also checked our backlog for any previous reports of similar issues on mobile devices with Android 11 and 13 and there were none.

The issue could be something specific to the particular device, for example third party anti-virus software that could be interfering with the upload process. Another thing we could suggest is to try enabling Chunk upload, because if the files are too big, that could cause the upload to fail. In our test we had a similar case on attempting to upload a 4.74MB file.

Stefan
Top achievements
Rank 1
Iron
Iron
Iron
commented on 18 Jan 2023, 03:41 PM

Hi Ivan,

thx for the info.

We will try to reproduce with bigger files too, and might try the Chunk upload (and maybe the newest Telerik version).
We'll let you know if we have any updates on this issue.

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