- Michal Schneider
- Member | 13
I'm using Nette 2.1.0 and I'm trying to insert data info filestream column, but without success.
<?php $values->data = fopen($values->data->getTemporaryFile(), "r"); // uploaded file $this->db->table("rawdata")->insert($data); ?>
Error message: Implicit conversion from data type nvarchar to varbinary(max) is not allowed. Use the CONVERT function to run this query.
I also tried something like this, but without success:
<?php $this->db->query("INSERT INTO rawdata ([data]) VALUES (CAST ('?' as varbinary(max)))", $data->data); ?>
I would apprisiate any useful advise.
Thanks a lot!