Recently, due to project needs, I want to make a click-to-download function, which can be implemented with HTML. But the problem now is that if it is an mp3 file, then the click will use the system's built-in player to open it. If target=_blank is used , the mp3 file will be opened and played in the browser's default mode. I haven't found a good solution yet. The project is in urgent need and is about to go online. Please give me guidance! ! Extremely grateful!
Packaged into rar format. . .
Packaged into rar format. . .
1
Use php to output the downloaded file. Before outputting, set the response header Content-Disposition to attachment; filename="xxx.mp3" will do.
Directly connecting to the mp3 file will call System handler to open