Skip to content

Commit

Permalink
Added delete method
Browse files Browse the repository at this point in the history
  • Loading branch information
babsgosgens committed Apr 19, 2011
1 parent d116e22 commit 3f1fae4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions admin/components/com_attachments/models/images.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ public function save($config = array())

// Define the file path and name
$file = $config->path.$config->name.$this->_getExt($config->mime);

// Make sure the path is writable
if(!JFolder::exists($config->path)) {
JFolder::create($config->path);
}

// Save the image

Expand Down Expand Up @@ -399,4 +404,11 @@ public function calculateWidth($dst_h)

return $dst_h / $src_h * $src_w;
}

public function delete($path)
{
if( JFile::exists($path) ) {
JFile::delete($path);
}
}
}

0 comments on commit 3f1fae4

Please sign in to comment.