XMLHttpRequest - file upload - timeout error

Hi,


Using HTML and plain vanilla XMlHttpRequest && FormData object to perform asynchronous Post method of multiple file uploads.

Form submission is of type multipart/form-data.

On iPhone on IOS 12.x and Safari to access the html form.


Around 5 files attached, usually total 13-16 MB.


The issue experienced is that the device would attempt to upload the request up to a certain point and then timeout, with the error

"Failed to load resource: The network connection was lost."


Although the connection timedout, the server side actually receives a properly constructed HTTP multipart form request, however, certain Content-Disposition sections where the binaries data should be are actually empty, resulting in only a subset of the attached files to be uploaded successfully.


Have tried setting the XMLHttpRequest.timeout parameter to a few minutes or 0 (indefinite wait), however the request will always timeout before that set.

It seems that the device is ignoring this setting (which is a standard)


Has anyone come across the same issue and what is the resolution?? This issue has NOT been observed on IOS 11.0.x and Android devices.



This is a sample of the http request received:


------WebKitFormBoundaryAfndB3xgJeYXKTAY

Content-Disposition: form-data; name="file"; filename="image1.jpg"

Content-Type: image/jpeg

binary data inserted here properly

------WebKitFormBoundaryAfndB3xgJeYXKTAY

Content-Disposition: form-data; name="file"; filename="image2.jpg"

Content-Type: image/jpeg

binary data inserted here properly

------WebKitFormBoundaryAfndB3xgJeYXKTAY

Content-Disposition: form-data; name="file"; filename="PDF Doc 175 KB.pdf"

Content-Type: application/pdf


EMPTY section with no data inserted

------WebKitFormBoundaryAfndB3xgJeYXKTAY

Content-Disposition: form-data; name="FormID"


xxxx

------WebKitFormBoundaryAfndB3xgJeYXKTAY--