Skip to content

Unable to write file into directory: Access forbidden #8212

Closed
@peterwdouglas

Description

@peterwdouglas

Not sure how to add a pull request so will post it here.

When adding an image to a product, it gives an error as the title says. so the image doesn't save.

To fix:

magento/magento2/blob/2e228234/app/code/Magento/Catalog/Model/View/Asset/Image.php

Change:

public function getPath()
{
return $this->getRelativePath($this->context->getPath());
}

replace with:

public function getPath()
{
$result = $this->context->getPath();
$result = $this->join($result, $this->getModule());
$result = $this->join($result, $this->getMiscPath());
return $this->join($result, $this->getFilePath());
}

This fixes the issue so dont know how to include this in the files to download.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Format is not validGate 1 Failed. Automatic verification of issue format is failedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for development

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions