Skip to content

Media copy error if destination folder does not exists #14

@igorsKolcinsMagebit

Description

@igorsKolcinsMagebit

Configurator does not copy image and throws and error if destination folder do not exists
image
Like we are trying to place image into pub/media/wysiwyg/icons, and icons does not eixsts
Easy fix is to manually create "icons" dir

Need to implement smth like this in file Component/Media.php:138

if (!is_dir('upload/promotions/' . $month)) {
  // dir doesn't exist, make it
  mkdir('upload/promotions/' . $month);
}

file_put_contents('upload/promotions/' . $month . '/' . $image, $contents_data);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions