Problem with pg_lowrite function (PostgreSQL)

From: Date: Fri, 28 Jul 2000 19:12:25 +0000
Subject: Problem with pg_lowrite function (PostgreSQL)
Groups: php.db 
Request: Send a blank email to php-db+get-1611@lists.php.net to get a copy of this message
Hi! I would like send via HTML form a GIF file from local machine to server and insert it into Postgres database. After that, I would like display this gif file on Web page. I try do this in that way: 1. <FORM METHOD="post" ACTION="file.php" ENCTYPE="multipart/form-data"> <INPUT TYPE=hidden NAME="max_file_size" VALUE="100000"> <INPUT TYPE="file" NAME="graphics"> <INPUT TYPE=submit NAME=action VALUE="Send it"> </FORM> 2. (file.php) <? $database = pg_Connect(); pg_exec ($database, "begin"); $oid = pg_locreate ($database); $handle = pg_loopen ($database, $oid, "w"); pg_lowrite ($handle, $graphics); pg_loclose ($handle); pg_exec ($database, "commit"); pg_exec ($database, "end"); ?> In $graphics I have string like this "/tmp/phpedFGUe" and when I try display the gif file (using pg_loreadall()) I can't see the image. If I display this object using "text/html" in header I have mentioned string ("/tmp/phpedFGUe") There is something strange else: If I insert the same gif file into database using psql, SQL language and postgres's "lo_import" function, I _can_ display it!!! So I supposed, that I do something wrong when I writing gif file into database from HTML form. Please help me, With best regards, Mariusz Topczewski

« previous php.db (#1611) next »