Topic: The Below code is not working to download sql file from server

i was trying to download sql file using this script.But its not working

 header("Content-type: 'application/sql'");
            header('Content-Length: '.filesize(dirname(dirname(__FILE__)).'/backups/'.$key.'.sql'));
            header('Content-Disposition: attachment; filename='.$key.'.sql');
            echo file_get_contents(dirname(dirname(__FILE__)).'/backups/'.$key.'.sql');
Subscription service based on FA
HRM CRM POS batch Themes

Re: The Below code is not working to download sql file from server

State where you are using this construct and context.

1. Remove pragma-cache
2. Set expiry for refresh to old date
3. Make sure file_get contents is within the max filesize and timeouts set in php.ini / apache conf files.
4. Zipping the sql will save bandwidth if http gz compression is not enabled.

View discussion.

Re: The Below code is not working to download sql file from server

I am trying to create sql backup and download it straight away for my extension(hrm). Which i am trying to use the FA backup codes.There it worked fine.But its not working properly.

Subscription service based on FA
HRM CRM POS batch Themes