Skip to content

Commit

Permalink
Fix for #532.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Syroeshko authored and Roman Syroeshko committed Jul 2, 2015
1 parent 7a2125c commit 988eaca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/PhpWord/TemplateProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,13 @@ public function saveAs($fileName)
unlink($fileName);
}

rename($tempFileName, $fileName);
/*
* Note: we do not use ``rename`` funcion here, because it looses file ownership data on Windows, and the file may not open.
*
* @see https://github.com/PHPOffice/PHPWord/issues/532
*/
copy($tempFileName, $fileName);
unlink($tempFileName);
}

/**
Expand Down

0 comments on commit 988eaca

Please sign in to comment.