2017-12-18 16:04 阅读 130


I'd like to give the user the possibility to download or stream the same media. I tried this way (adding download) but it doesn't work:

<a target='_blank' href='http://another/site/file.mp4' download>DOWNLOAD</a>
<a target='_blank' href='http://another/site/file.mp4'>STREAMING</a>

I create the page using php 5.6

Note that the file is always the same: http://another/site/file.mp4 and comes from a different domain (The <a> urls are in site1 and the media is in site2 )

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    duanqiang5722 duanqiang5722 2017-12-18 16:12

    The download attribute on <a> tags only work with the following:

    • The URL must be the same origin as the HTML document.
    • The browser must be Chrome, Firefox, Edge, Safari (10) or Opera (15)

    I'm going to assume the URL is from another website, and that's why it's not working.

    点赞 评论 复制链接分享