Forcing to download a file using PHP

前端 未结 10 977
借酒劲吻你
借酒劲吻你 2020-11-22 04:04

I have a CSV file on my server. If a user clicks on a link it should download, but instead it opens up in my browser window.

My code looks as follows



        
10条回答
  •  后悔当初
    2020-11-22 04:44

    This means that your browser can handle this file type.

    If you don't like it, the easiest method would be offering ZIP files. Everyone can handle ZIP files, and they are downloadable by default.

提交回复
热议问题