How to solve the php header build download link, resulting in some browsers without file suffixes

in order to make it easy to change the same download link in multiple places, I made a jump with php:

public function getUavManagerLinkAction()
    {
        $path = "http://files-10008291.cos.myqcloud.com/app/UAVManagerProfessional.exe";
        Header("Location: $path");

        exit;

    }

the front-end html link points to this action:

<a download="getUavManagerLink" href="/File/getUavManagerLink" target="_blank"></a>

most browsers download normally
only roaming 5 and some IE downloads result in no file suffix exe.

Mar.12,2021

try this:

<a download="getUavManagerLink.exe" href="/File/getUavManagerLink" target="_blank"></a>

refer to the dwanload attribute of html5: http://www.w3school.com.cn/ta.

Menu