Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
Not able to view or download file on iPhone + SAPUI5

This code works great on tablets and desktop, but when I try on iPhone it is not downloading any file. Please help

if (aData.ExternalUrl === "") {
  this.oModel.read("/GetAttachmentBase64Set('" + aData.DocumentId + "')", {
    success: function (oData, oResponse) {
      oList.setBusy(false);
      var dataURI = oData.EvAttachmentData;

      if (Device.system.tablet ||Device.system.phone) {
        window.open(dataURI, "_blank");
        return;
      }
      dataURI = dataURI.substring(dataURI.indexOf(",") + 1);

      var raw = window.atob(dataURI);
      var rawLength = raw.length;
      var array = new Uint8Array(new ArrayBuffer(rawLength));

      for (var i = 0; i < rawLength; i++) {
        array[i] = raw.charCodeAt(i);
      }

      var saveByteArray = (function () {
        var a = document.createElement("a");
        document.body.appendChild(a);
        a.style = "display: none";
        return function (data, name) {
          var blob = new Blob(data, {
              type: "octet/stream"
            }),
            url = window.URL.createObjectURL(blob);
          a.href = url;
          a.download = name;
          a.click();
          window.URL.revokeObjectURL(url);
        };
      }());

      saveByteArray([array], aData.Filename);

      oList.removeSelections();
    },

This code works great on tablets and desktop, but when I try on iPhone it is not downloading any file. Please help

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!