Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
686 views
in Technique[技术] by (71.8m points)

html - A Tag with download attribute not work in iphone?

I have to working for download video. I used the anchor tag and in which used download attribute. It would be working properly in all browser but in iphone, it directly plays that video.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It's supported in iOS Safari from v13.1 onwards. See here: https://caniuse.com/#feat=download

In your content type header you can

You can hack it to work by setting the content type header in your server response

Content-Type: application/force-download

See this: Force file download from HTTP on iOS


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...