download wordpress table as csv from wordpress plugin

I am creating wordpress plugin that has some custom tables with it. Using plugin admin menu it should be able to upload and download data to the custom table. I can upload data into table without problem, but download has problems. Tried few methods but none of its working( with using headers).

Found some samples with editing functions.php in wordpress but I can’t edit the wordpress funciton.php. code must be in the plugin itself. Any idea how to resolve download customer table from wordpress plugin admin menu.

Related posts

Leave a Reply

2 comments

  1. Yes. I found the way. My problem is related to sending the header to csv when try to download( Header already send). So I’ve put the download csv function in the plugin admin index page and add to admin hook to it. so when ever I called the function its go through this hook and add the header to response request.