<?php 
@ini_set("display_errors","1");
@ini_set("display_startup_errors","1");

require_once("include/dbcommon.php");

require("MyCode/FacturaWord.php");

$temp_file = create_factura();

$documento = file_get_contents($temp_file);
unlink($temp_file);  // delete file tmp
header("Content-Disposition: attachment; filename= factura.docx");
header('Content-Type: application/docx');
echo $documento;

    