gruetztian
04-12-2005, 03:16 AM
hi,
can someone help me please. i try to work with php fileoperations and mysql blob datatypes.
i have a (apache)webserver and a mysql database running on a suse linux system.
my problem is.
if i try to open a file for example test.pdf and its 118 KB large insert it into a table, later read the data from the blob field i only get 64 KB back no matter which size (larger then 64KB).it is a problem with the settings yes?but where is the problem apache (httpd.conf), php or mysql (/etc/my.cnf)?
a code example.
//table has a id and a blob field called data
$query = "INSERT INTO table (data) VALUES (\"".addslashes(fread(fopen("test.pdf","r"),filesize("test.pdf")))."\")";
mysql_query($query,$conn);
//read data
$query = "SELECT data from table WHERE id=1";
$rs = mysql_query($query,$conn);
$row = mysql_fetch_row($rs);
header("Content-Type: application/pdf");
echo $row;
max size of returned data is 64KB
can someone help me please. i try to work with php fileoperations and mysql blob datatypes.
i have a (apache)webserver and a mysql database running on a suse linux system.
my problem is.
if i try to open a file for example test.pdf and its 118 KB large insert it into a table, later read the data from the blob field i only get 64 KB back no matter which size (larger then 64KB).it is a problem with the settings yes?but where is the problem apache (httpd.conf), php or mysql (/etc/my.cnf)?
a code example.
//table has a id and a blob field called data
$query = "INSERT INTO table (data) VALUES (\"".addslashes(fread(fopen("test.pdf","r"),filesize("test.pdf")))."\")";
mysql_query($query,$conn);
//read data
$query = "SELECT data from table WHERE id=1";
$rs = mysql_query($query,$conn);
$row = mysql_fetch_row($rs);
header("Content-Type: application/pdf");
echo $row;
max size of returned data is 64KB