Problem is that i can't save file to blob. It works without any error, temp file is created and i can read from it. I checked if it goes to bind - yes it goes with right resource value and with \PDO::PARAM_LOB
data type.
I have an ActiveRecord class:
class News extends ActiveRecord
{
public function rules()
{
return [
[
['image'],
'image',
'extensions' => 'png jpg',
'maxSize' => 1024 * 300,
]
];
}
public function beforeSave($insert)
{
$fileInfo = UploadedFile::getInstance($this, 'image');
$this->image = fopen($fileInfo->tempName, 'r+');
return parent::beforeSave($insert);
}
}
Table:
CREATE TABLE NEWS
(
RN NUMBER(17,0) PRIMARY KEY NOT NULL,
IMAGE BLOB
);
Logs showing this query:
INSERT INTO "NEWS" ("IMAGE") VALUES (:qp4) RETURNING "RN" INTO :qp8
So it didn't actually bind it or what?