Skip to content

Instantly share code, notes, and snippets.

@sohelrana820
Created May 12, 2014 13:26
Show Gist options
  • Save sohelrana820/45d1b497761f359a31a8 to your computer and use it in GitHub Desktop.
Save sohelrana820/45d1b497761f359a31a8 to your computer and use it in GitHub Desktop.
public function uploadImage($filename, $document, $path)
{
$ext = $this->Img->ext($document['name']);
$origFile = $filename. '.'. $ext;
$targetDir = WWW_ROOT . $path;
$upload = $this->Img->upload($document['tmp_name'], $targetDir, $origFile);
if ($upload == 'Success') {
return 'category/'.$origFile;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment