I wrote PHP code to export data to .csv file. The exported .csv file was downloadable on my own PC. But in client’s server, the .csv file was not downloadable, it was in readable format (the browser can read and print the file contents like a .html file).
I used header() before accessing the .csv file.
Is it a server side problem or do I need to change my code?
You need to send headers to tell the client what kind of file to expect and what to do with it.