Download custom file in wordpress backend [duplicate]

Now it is solved, what i have done is, just hook my download script to admin_init hook and its working that i want.

This is the helpful link Headers already sent error with CSV export plugin