jozenbasin
jozenbasin

Reputation: 2552

Prompt download for Safari and Chrome on iPhone

I'm using the download attribute for mp3 files eg

<a class="btn btn-primary" href="/content/file.mp3" download="">Download File</a>

But when users with an iPhone or iPad click this button in both Safari and Chrome, it does not download but instead opens in quick time or some audio player. How can I force a download?

Upvotes: 1

Views: 1543

Answers (1)

Mitchell Currie
Mitchell Currie

Reputation: 2809

Short answer: you can't.

Based on the MIME type, safari will start playing it. The only way to save files is to use iBooks for PDF to click "open with" if it is allowed.

iOS will typically interact with a file rather than download it, as that is a better experience. Some certain file manager applications will let you download a url. You could have a shortcut to copy the URL to the clipboard to help the user, but other than that I'm not sure there is a way on iOS.

Upvotes: 3

Related Questions