Xamarin.IOS can upload only 3 pics from gallery

gaborxgaborx USMember ✭✭

Hi,
I am developing an IOS app and i have a very weird problem. I select multiple images from gallery and upload them to our server. It works perfectly up to a point. I can upload even 10 files from the app directory (included in the project) with no problem at all, but when I try to upload multiple files from the phone gallery only 3 pictures gets uploaded. I get no error message, no warning, nothing. Seems IOS "thinks" it has sent all images and uploaded them but whatever I do, only 3 images gets uploaded. I tried with different images in different sizes. Always only 3 images uploaded.
The code I use to upload images:

        Console.WriteLine("jobpics count: " + jobpics.Count().ToString()); //-- 10 images in the JobPics

        foreach (var Pic in jobpics)
        {
            i++;
            using (var webClient = new WebClient())
            {
                var uri = new Uri("ourwebapiurl/UploadPic/" + JobID.ToString());

                webClient.UploadFileAsync(uri, "POST", Pic.FileName, i);

                Console.WriteLine("upload started ({0})", Pic.FileName); //-- all 10 image upload started properly 

                webClient.UploadProgressChanged += HandleUploadProgressChanged; 

        //-- i see progress for all 10 images and all finish with 100% uploaded but still only 3 appear on server.

            }
        }
Tagged:

Answers

  • andnesandnes USMember ✭✭✭

    Hi,
    Does this problem only occur on iOS? The server might have a default maximum data transfer size which needs to be overridden.

  • gaborxgaborx USMember ✭✭

    @andnes said:
    Hi,
    Does this problem only occur on iOS? The server might have a default maximum data transfer size which needs to be overridden.

    It occurs only when I try to upload from IOS photo gallery. I can upload any amount of files in any sizes from the application own directory from the phone, so its def not the server.

  • gaborxgaborx USMember ✭✭

    Now I save the selected images into a temp folder and from there all uploads correctly. It's weird.

Sign In or Register to comment.