How to fix the «Unable to write file into directory: Access forbidden» bug in Windows?

Find the method:

Replace it with the following one:

public function getPath()
{
	// 2016-12-16
	// https://mage2.pro/t/2389
	$result = $this->context->getPath();
	$result = $this->join($result, $this->getModule());
	$result = $this->join($result, $this->getMiscPath());
	return $this->join($result, $this->getFilePath());
}

It has been fixed in the core on 2017-02-14:
https://github.com/magento/magento2/commit/73829f422e

See also: