Bug #12041 Updated: Incorrect upload graphics files into MySQL when start PHP as Apache module

From: Date: Wed, 11 Jul 2001 08:57:06 +0000
Subject: Bug #12041 Updated: Incorrect upload graphics files into MySQL when start PHP as Apache module
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-59669@lists.php.net to get a copy of this message
ID: 12041 Updated by: derick Reported By: dva@vlas.ru Old Status: Open Status: Bogus Bug Type: Apache related Operating System: Windows98 PHP Version: 4.0.6 New Comment: You need to fopen the file with the "rb" settings. Windows wants these files opened as binary. Derick Previous Comments: ------------------------------------------------------------------------ [2001-07-11 04:54:39] dva@vlas.ru $fd = fopen ($imagefile, "r"); $imagedata = addslashes ( fread ( $fd, filesize ($imagefile) ) ); fclose ($fd); $link = mysql_connect ($Hostname, $Username, $Password) or die (mysql_errno($link).mysql_error($link)); $db = mysql_select_db ($Database, $link) or die (mysql_errno($link).mysql_error($link)); $query = "INSERT INTO $TableBanner (id, image) VALUES ('NULL', '$imagedata')"; @mysql_query ($query, $link) or die (mysql_errno($link).mysql_error($link)); mysql_close ($link); ------------------------------------------------------------------------ ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=12041&edit=1

« previous php.dev (#59669) next »