Jump to content
php.lv forumi

Kohana Upload::save()


vitalja

Recommended Posts

		/*
			$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.

Link to comment
Share on other sites

ErrorException [ 8 ]: Array to string conversion ~ SYSPATH/classes/Kohana/Log/Writer.php [ 81 ]

 

Nezinu iespējams var kautkādā veidā ieslēgt normālos errorus, bet man nav izdevies to izdarīt, šis errors man parasti uzrādas sintakses kļudās.

Savāds errors, jo system mapi es vispār neesmu aizticis.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...