Skip to content

Commit

Permalink
Small bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmulder committed Jun 2, 2015
1 parent 97bc3aa commit ca7dd40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Model/Behavior/UploadableBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ protected function _ifUploaded($entity, $field)
protected function _uploadFile($entity, $field, $options = [])
{
$_upload = $entity->get($field);
$uploadPath = $this->_getPath($entity, $field, ['file' => true]);
$uploadPath = $this->_getPath($entity, $field, ['file' => false]);

// creating the path if not exists
if (!file_exists($this->_getPath($entity, $field, ['file' => false]))) {
$this->_mkdir($this->_getPath($entity, $field, ['file' => false]), 0777, true);
if (!is_dir($this->_getDir($entity, $field, ['file' => false]))) {
$this->_mkdir($this->_getDir($entity, $field, ['file' => false]), 0777, true);
}

// upload the file and return true
Expand Down

0 comments on commit ca7dd40

Please sign in to comment.