1

I have created a webapp meant for both desktop and mobile devices, using Angular JS. There's one page with the feature to upload a file to the server. File upload button is created using:

 <input type="file" auto-upload="addFile"/>`

The file upload button works perfectly fine on desktop, Android devices and iPhone (iOS 10.x.x) but fails on iPhones with iOS 11.x.x It doesn't even open a dialog to select a file regardless of the browser you use. The button click doesn't nothing.

Does anyone have any clue to what's happening here?


auto-upload is a custom directive. Code is below:

directive('autoUpload', function () { 
   return { restrict: 'AEC',
            scope: { autoUpload: '=', 
                     jobSiq: '=' }, 
            link: function link($scope, element) {
                element.bind('change', function (e) {
                    $scope.autoUpload(e, $scope.jobSiq);
                    e.target.value = null;
                });
            } 
   }; 
})
Community
  • 1
  • 1
uncommon_breed
  • 172
  • 2
  • 2
  • 13
  • See [Angular/Material Issue #1545 -- Input type="file" not working on mobile devices.](https://github.com/angular/material/issues/1545). – georgeawg Dec 18 '17 at 21:15
  • Possible duplicate of [iPhone File Upload with HTML](https://stackoverflow.com/questions/5784352/iphone-file-upload-with-html) – georgeawg Dec 18 '17 at 21:25
  • Possible duplicate of [A html5 web app for mobile safari to upload images from the Photos.app?](https://stackoverflow.com/questions/3891831/a-html5-web-app-for-mobile-safari-to-upload-images-from-the-photos-app/40529202#40529202). – georgeawg Dec 18 '17 at 21:26
  • @georgeawg: auto-upload is a custom directive. Code is below: `directive('autoUpload', function () { return { restrict: 'AEC', scope: { autoUpload: '=', jobSiq: '=' }, link: function link($scope, element) { element.bind('change', function (e) { $scope.autoUpload(e, $scope.jobSiq); e.target.value = null; }); } }; }` Corrected the title now. It's iOS 11 and not 10. I'll look at the links you pointed to for further answers. Thanks a lot. – uncommon_breed Dec 18 '17 at 22:09

0 Answers0