/*
$image == $_FILES['image'] (array)
$directory == 'uploads/' (string)
*/
if ($file = Upload::save($image, NULL, $directory))
{
$this->message = $file;
$this->filename = strtolower(Text::random('alnum', 20)).'.jpg';
Image::factory($file)
->resize(200, 200, Image::AUTO)
->save($directory.$this->filename);
// Delete the temporary file
unlink($file);
return $this->filename;
}
Labdien! Vai kāds varētu paskaidrot kāpēc nestrādā if statementa rindiņa, jeb Upload::save($image, NULL, $directory)
bootstrap.php failā esmu aktivizējis image moduli.