Unable to upload a file to an internal webpage using Secure Web

Unable to upload a file to an internal webpage using Secure Web

book

Article ID: CTX226990

calendar_today

Updated On:

Description

XenMobile 10.x
Secure Web 10.x
iOS 10.x

User able to access the upload site, however, upload never completes successfully w/ no error or other notification.  Behavior doesn't occur when attempting same on an Android device.

Resolution

When reviewing code reference in originating site, we see that if updated, this would also resolve:

In customer website’s code, there is a following method:
 
function openIOSAttachment(url) {
if (window.navigator.standalone) return;if (isMAF() == "1") return;var win = window.open();if (win)
win.document.location = url;}
 
Here, win will be undefined because window.open() is undefined for UIWebView. If customer makes the following change in this method, then this issue will be resolved.
 
Do not use
var win = window.open();if (win)
win.document.location = url;
 
Use
window.open(url);
 

We have added a workaround to this limitation and verified the fix.  Correction (workaround) to be included in future Sprint Release (Sprint Release 56) slated tentatively for 10/11.


Problem Cause

Bug/Limitation within the UIWebView and JavaScript interaction.  The link derived is as follows: 'javascript:submitAction_win0(document.win0,ADD_PHOTO_BTN').  

On tapping on upload button, an XMLHTTPReqtest is created in JavaScript and image is sent to server. Server in turn returns a response back to Secure Web (I can see the 200 response in SW network callbacks) but for some reason response is not propagated to JavaScript. We don’t have much control on this intermediate portion to identify what is preventing the data from reaching JavaScript code as this happens inside iOS SDK(UIWebView).

 

Issue/Introduction

When leveraging iOS, user unable to upload file to internal web page using Secure Web.