php - can download file in localhost but not server -
anyone face problem before? implement backup php script. when click button download. file auto download , store in localhost folder.
but when upload script server , seek run, script can run , display successful message. no file download.
//save backup sql file $handle = fopen($dbname.'-database-backup-'.$table.date('y-m-d @h-i-s').'.sql','w+'); fwrite($handle,$data); fclose($handle);
below script wrote. php script
try using next header in php. example:
header('content-disposition: attachment; filename=my.sql'); header('content-type: text/plain');
php sql
No comments:
Post a Comment