Skip to content

Instantly share code, notes, and snippets.

@emersonthis
emersonthis / A few questions about CakePHP FileStorage plugin.md
Last active August 29, 2015 14:11
Questions about CakePHP FileStorage plugin

##1. Implementing delete I've updated ListingPhoto.php below with my code to delete files.

    public function afterDelete() {
        StorageManager::adapter($this->record['Photo']['adapter'])->delete($this->record['Photo']['path']);
    }

I copied this directly from the docs here but when I run it I get the following error: Unable to remove the "images/.../.../...jpg" key.

I checked and the path to the file is correct. And I don't think it's a permissions problem because PHP wrote the files to that location already.