Window.location.href open address of each terminal performance is different, expected to pop up the download box, what should be done?

for example, use window.location.href to open this address: "http://srv-file.lehuomao.com/R.FhLetITQrMkKPH7J6-gz_qu3Rdbx.8IqVjCe?attname=114935985_0-1524097469-31b1c44e-63ff-ecea_00001.ts&e=1544177078&token=A-SxvcKX-cElDR8djvNfz0BbAx0-tsc5iD9gf7qq:_BFUpEJ7G_9k0NhZjxM-XSOukg4="

"

Android can pop up the download box normally;
safari opens this page:
clipboard.png

Open the garbled code directly in Wechat
what to do with it

Jan.19,2022

the content-type returned by your address is video/MP2T
different browsers may have different treatments for this.
if you want to download, you need to change the content-type, for example, to application/octet-stream (binary stream).


window.location.href is the punch-in address of the pop-up new browser window. The pop-up download box is the behavior of the browser itself, and you cannot intervene through the script.

the table is installed because the browser does not recognize the file type, so it is prompted to download by default. It has nothing to do with whether you use window.location.href or not.

ios does not support downloading any files other than pictures, so you have no solution in safari.

the normal practice in Wechat is to guide the user to open it through the browser in the upper right corner.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b502-2c278.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b502-2c278.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?