Hi,
I can't figure out what's the way of uploading a file from drive to a blob .
I have a table : CREATE TABLE "IMGTEST"
(
"NAME" VARCHAR(8),
"IMG" BLOB SUB_TYPE 0 SEGMENT SIZE 80
)
And the code :
$dbh = ibase_connect("faludig:d:\\interbase\data\WebTasks.gdb","sysdba","masterkey");
$blob_id = ibase_blob_create($dbh);
if (is_uploaded_file($myfile)){
copy($myfile,"D:/gabor.jpg");
}
$fh = fopen("d:/gabor.jpg","r");
$blob_id_str = ibase_blob_import($dbh,$fh);
fclose($fh);
//ibase_blob_add($blob_id,$miez) ;
// $blob_id_str = ibase_blob_close($blob_id);
$sql = "insert into imgtest values ('$name',?)";
ibase_query($dbh,$sql,$blob_id_str);
ibase_close($dbh);
but it chrashes my php.exe (run as cgi )
I can't figure out what's the way of uploading a file from drive to a blob .
I have a table : CREATE TABLE "IMGTEST"
(
"NAME" VARCHAR(8),
"IMG" BLOB SUB_TYPE 0 SEGMENT SIZE 80
)
And the code :
$dbh = ibase_connect("faludig:d:\\interbase\data\WebTasks.gdb","sysdba","masterkey");
$blob_id = ibase_blob_create($dbh);
if (is_uploaded_file($myfile)){
copy($myfile,"D:/gabor.jpg");
}
$fh = fopen("d:/gabor.jpg","r");
$blob_id_str = ibase_blob_import($dbh,$fh);
fclose($fh);
//ibase_blob_add($blob_id,$miez) ;
// $blob_id_str = ibase_blob_close($blob_id);
$sql = "insert into imgtest values ('$name',?)";
ibase_query($dbh,$sql,$blob_id_str);
ibase_close($dbh);
but it chrashes my php.exe (run as cgi )