Re: [PHP-DB] File upload bug
Hello Daniel, you said you change all the max_limit stuff in PHP/Apache, but did you change it on mysql ? by default the mysql_allowed_package is set to 1M, you have to add a line in your my.ini file (in my case this is in the windows directory, if you are using linux search google :)) In the section [mysqld] add set-variable = max_allowed_packet=10M or the value you want. I had a similar problem in a desktop application that inserted images into the database it gave the erro mySQL has gone away and this was the solution. Hope this Hepls. - Original Message - From: Daniel Crespo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 7:19 PM Subject: [PHP-DB] File upload bug Hi all you there... I realized that when I try to upload a file of about 1MB or more, it doesn't upload... Even changing all the max_limit stuff at the config files of Apache and PHP... So, I don't now how to solve this. In the form, there are: form enctype=multipart/form-data name=frmUploadFile action=upload.php method=post input type=text name=strDesc size=20 maxlength=50 input type=file name=fileUpload size=20 /form In upload.php there are: ? global $strDesc; global $fileUpload; global $fileUpload_name; global $fileUpload_size; global $fileUpload_type; $fileHandle = fopen($fileUpload, rb); $fileContent = fread($fileHandle, $fileUpload_size); $fileContent = addslashes($fileContent); $dbQuery = INSERT INTO myBlobs VALUES ; $dbQuery .= (0, '$strDesc', '$fileContent', '$fileUpload_type'); db_query($dbQuery) or die(Couldn't add file to database); ? With short files (up to 1MB aprox.), it works just perfect... But, more than this, the variable $fileUpload_size, for example, is 0 (Zero)... So, anyone know how to fix this? Thanks. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] File upload bug
Hi all you there... I realized that when I try to upload a file of about 1MB or more, it doesn't upload... Even changing all the max_limit stuff at the config files of Apache and PHP... So, I don't now how to solve this. In the form, there are: form enctype=multipart/form-data name=frmUploadFile action=upload.php method=post input type=text name=strDesc size=20 maxlength=50 input type=file name=fileUpload size=20 /form In upload.php there are: ? global $strDesc; global $fileUpload; global $fileUpload_name; global $fileUpload_size; global $fileUpload_type; $fileHandle = fopen($fileUpload, rb); $fileContent = fread($fileHandle, $fileUpload_size); $fileContent = addslashes($fileContent); $dbQuery = INSERT INTO myBlobs VALUES ; $dbQuery .= (0, '$strDesc', '$fileContent', '$fileUpload_type'); db_query($dbQuery) or die(Couldn't add file to database); ? With short files (up to 1MB aprox.), it works just perfect... But, more than this, the variable $fileUpload_size, for example, is 0 (Zero)... So, anyone know how to fix this? Thanks. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re:RE: [PHP-DB] File upload bug
No. I think that's not the problem, because even if I just submit the form with a large file, it doesn't send... Before php process the MySQL instructions, it hangs up (just to name it in some way) and return nothing. So MySQL is not the problem. :( kevin myers wrote: you might true checking the setting in MySQL, since that seems to be where are uploading it to. some configureations of MySQL set a file size limit that can be loaded in at once From: Daniel Crespo To: [EMAIL PROTECTED] Subject: [PHP-DB] File upload bug Date: Wed, 24 Mar 2004 15:19:15 -0400 Hi all you there... I realized that when I try to upload a file of about 1MB or more, it doesn't upload... Even changing all the max_limit stuff at the config files of Apache and PHP... So, I don't now how to solve this. In the form, there are: action=upload.php method=post In upload.php there are: global $strDesc; global $fileUpload; global $fileUpload_name; global $fileUpload_size; global $fileUpload_type; $fileHandle = fopen($fileUpload, rb); $fileContent = fread($fileHandle, $fileUpload_size); $fileContent = addslashes($fileContent); $dbQuery = INSERT INTO myBlobs VALUES ; $dbQuery .= (0, '$strDesc', '$fileContent', '$fileUpload_type'); db_query($dbQuery) or die(Couldn't add file to database); ? With short files (up to 1MB aprox.), it works just perfect... But, more than this, the variable $fileUpload_size, for example, is 0 (Zero)... So, anyone know how to fix this? Thanks. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.com/go/onm00200415ave/direct/01/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php