1

I have something very simple.

I will put a simple bloburl to a href of an a tag.

<a id="downloadReady" class="btn btn-primary" download=""
   href="blob:https://pic2.conveyor.cloud/934d8e82-cfb2-43d4-b0f9-00822621f772">
   Download Ready!
</a>

Super simple.

On android, windows, blackberry etc it works. On ios i get following message after 3 taps.

This website is repeatedly trying to open another application

Granted the image is large, not very but it was from iphone camera, on smaller images it works.

I cannot embed in jsbin because there is a bug currently. Maybe somebody can help me out?

Note: the code is used in a simple website, in the browser, not a native hybrid web app like ionic etc.

vinayakj
  • 5,591
  • 3
  • 28
  • 48
Aflred
  • 4,435
  • 6
  • 30
  • 43

1 Answers1

0

I was also facing exactly the same issue while downloading pdf on iOS using Chrome Browser. I used fileReader approach to fix that. Also I added this under condition that this code should work only for Chrome on iOS. Below is my code

 if (window.navigator.userAgent.toLowerCase().indexOf('crios') > -1) {
        const fileReader = new FileReader()
        const blobUrl = new Blob([serviceResponse.data], { type: 
        'application/pdf' })
          fileReader.onload = function (event) {
            window.location.href = reader.result
          }
          fileReader.readAsDataURL(blobUrl)
    }

Let me know in case you need further clarification.

Shahzad
  • 131
  • 4