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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)