Skip to content

Commit

Permalink
Merged PHPOffice#532.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Syroeshko committed Aug 16, 2015
1 parent 5a22f57 commit 7c371e1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/PhpWord/TemplateProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,14 @@ public function saveAs($fileName)
unlink($fileName);
}

rename($tempFileName, $fileName);
/*
* Note: we do not use ``rename`` function here, because it looses file ownership data on Windows platform.
* As a result, user cannot open the file directly getting "Access denied" message.
*
* @see https://github.com/PHPOffice/PHPWord/issues/532
*/
copy($tempFileName, $fileName);
unlink($tempFileName);
}

/**
Expand Down

0 comments on commit 7c371e1

Please sign in to comment.