Quantcast
Channel: PHPWord
Viewing all articles
Browse latest Browse all 450

New Post: Downloading doc file without saving file on server

$
0
0
Krishna-Winnou systems and services
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');

$filename = 'myfile.docx';//krishna

$objWriter->save($filename);

header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$filename);
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($filename));
flush();
readfile($filename);
unlink($filename); // deletes the temporary file
exit;

Viewing all articles
Browse latest Browse all 450

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>