php - saving the pdf using phpexcel terminate the rest of the script -
the echo statement not running , below script not running
header("http/1.1 200 ok"); header("pragma: public"); header("cache-control: must-revalidate, post-check=0, pre-check=0"); header("cache-control: private", false); header('content-type: application/pdf'); header('content-disposition: attachment;filename="rename.pdf"'); //tell browser what's file name header('cache-control: max-age=0'); //no cache $objwriter = phpexcel_iofactory::createwriter($objphpexcel, 'pdf'); $objwriter->setsheetindex($i); $objwriter->save('php://output'); echo "this not diplaying"; //code terminated
don't echo when you're sending data php://output
file headers.... echo sends data php://output
..... you're doing writing "this not diplaying"
@ bottom of file you're sending.... , likelihood corrupt file
Comments
Post a Comment