> Gostaria de um exemplo ou um link para gravar arquivos no tipo bytea.
Considerando um Tabela assim :
CREATE TABLE files (
id_file SERIAL PRIMARY KEY,
filename varchar(255) ,
mime varchar(255),
content bytea
);
<?php
include('conn.php');
$file = "/home/thiago/test.php";
$fc = pg_escape_bytea(file_get_contents($file));
$mime = mime_content_type($file);
$sql = "INSERT INTO files (filename,mime,content) VALUES
('$file','$mime','$fc');
$rs = pg_query($sql);
?>
Algo do Tipo ... Naum testei o exemplo ... pode ter erros !!!
--
Att:
Thiago Risso
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral