sqlsrv insert data into filestream column
Notice: This thread is very old.
- Michal Schneider
- Member | 13
Hi,
I'm using Nette 2.1.0 and I'm trying to insert data info filestream column, but without success.
My code:
<?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!
- Michal Schneider
- Member | 13
I found that example too, I'll try it via PDO. I'll send a resulting code, if I'm sucessful.
Thanks a lot!