提示在iPhone上下载Safari和Chrome浏览器 [英] Prompt download for Safari and Chrome on iPhone

查看:142
本文介绍了提示在iPhone上下载Safari和Chrome浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将download属性用于mp3文件,例如

I'm using the download attribute for mp3 files eg

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

但是,当拥有iPhone或iPad的用户在Safari和Chrome浏览器中均单击此按钮时,它不会下载,而是在快速时间内打开或打开某些音频播放器.如何强制下载?

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?

推荐答案

简短的回答:不能.

基于MIME类型,safari将开始播放它.保存文件的唯一方法是使用iBooks for PDF在允许的情况下单击打开方式".

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通常会与文件交互而不是下载文件,因为这是更好的体验.某些文件管理器应用程序将允许您下载URL.您可以使用快捷方式将URL复制到剪贴板上,以帮助用户,但除此之外,我不确定iOS上是否可以使用该方法.

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.

这篇关于提示在iPhone上下载Safari和Chrome浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆