ok, I have a script that takes files from a HTTP post and loads them 
into a mySQL database.  Whenever I try to load a file greater than a meg 
ot two, I get mySQL error #2006, MySQL server has gone away.  I checked 
upload_max_filesize in php.ini and that's not the problem, also 
MAX_FILE_SIZE input tag is not the problem.  Anyone have any ideas?

Here the basic code that does the upload.  There is some other code that 
collects other info and some error checking.  I'm not hitting max 
execution time.  So what gives?  Thanks in advance for your help.

BTW, PHP 4.2.1, my SQL 3.23.49-nt

$f1=fopen($_FILES['newfile']['tmp_name'], "r");
$file=fread($f1, $_FILES['newfile']['size']);
$file=AddSlashes($file);
$insertQuery = "INSERT INTO media_files SET                                            
 shortdesc='{$_POST['short']}',                                                  
longdesc='{$_POST['longdesc']}',                                                
username='{$_POST['user']}',                                                    
mimetype='{$_FILES['newfile']['type']}',                                        
filedata='{$file}',                                                             
filesize='{$_FILES['newfile']['size']}',                                        
filename='{$_FILES['newfile']['name']}', 
                                uploaded=CURDATE(),                                    
                         category1='{$_POST['gen']}',                                  
                  category2='{$_POST['category']}' 
                                        ";

Please help.  Thanks.
- Anthony


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to