Already have the file address returned by the backend, how to control the browser download?

I did this before: click the "download" button, and the backend will return the file address, then change the value of downloadUrl to download successfully

<a class="link" href="{{downloadUrl}}" ng-click="download()"></a>

is there any other way? I always feel so stupid.

Mar.18,2021

you can download


by opening the new page directly in the click method.

try location.href = downloadUrl

.
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-1e4c9a4-44ec9.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-1e4c9a4-44ec9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?