Using php to force download a pdf

后端 未结 5 1527
渐次进展
渐次进展 2020-12-17 21:25

Im trying to get a website to have a button that forces a download of a pdf.

Heres the html of the button:

    
           


        
5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-17 21:58

    Try removing the path to the file and just leave the file name in the content:

    header('Content-Type: application/pdf');
    header('Content-disposition: attachment; filename=ECM_IT_ResumeDownload.pdf');
    

提交回复
热议问题