Prompt file download

前端 未结 5 1874
一生所求
一生所求 2020-12-11 14:39

I have a link on my page on click of which I am trying to generate a PDF document and then show the \"Open - Save\" prompt on the browser.

My HTML (reactjs component

5条回答
  •  孤街浪徒
    2020-12-11 15:29

    A simple way to do this is on your server to use GET method, and receive your data by query parameters.

    Then in your client app you just have to create a classic link:

    Test Link
    

    Or use that simple js script if your want to manage it from your script logic:

    window.open("http://your-server.com/your-resource?param1=123¶m2=456");
    

提交回复
热议问题