Re: Can't upload files > then 400K to MySQL

From: Date: Mon, 29 Dec 2003 21:25:31 +0000
Subject: Re: Can't upload files > then 400K to MySQL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-173449@lists.php.net to get a copy of this message
Have you taken a look at the post below: Can't upload files Greater than 11KB? We may have the same problem. "Ahmetax" <ahmetax@axtelsoft.com> wrote in message news:20031228111514.61858.qmail@pb1.pair.com... > Hi, > > I have the following PHP code to upload files to a MySQL table. > > It works fine, but, I can't upload any files greater then 400K. > > What might be the problem? > > TIA > > ahmet > > <? > if (isset($_POST["submit"])) > { > $fname= $_FILES["user_file"]["name"]; > $tmp= addslashes($_FILES["user_file"]["tmp_name"]); > $size= $_FILES["user_file"]["size"]; > $type=$_FILES["user_file"]["type"]; > $tanim=$_FILES["user_file"]["file_desc"]; > $fd=fopen($tmp,"r") or die("Can't open file!"); > $fdata=urlencode(fread($fd,filesize($tmp))); > $size=filesize($tmp); > $tanim=$descript; > include("baglan.inc"); > > mysql_select_db("dosyalar"); > $sql="INSERT INTO files (name,file_type,file_desc,file_data,file_size)". > " > VALUES('$fname','$type','$descr','$fdata','$size')"; > mysql_query($sql); > } > ?> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > <html> > <head> > <title>AxTelSoft-Uploading a file </title> > <meta http-equiv="Content-Type" content="text/html; > charset=windows-1254"> > <meta http-equiv="Content-Type" content="text/html; > charset=iso-8859-9"> > <meta http-equiv="Content-Language" content="tr"> > <meta http-equiv="description" content="axtelsoft, indir, download, delphi, > source code, kaynak kod"> > <meta http-equiv="Pragma" content="no-cache"> > <meta name="Generator" content="Ahmet Aksoy"> > </head> > <body> > > <form enctype="multipart/form-data" action="<?php echo > $SERVER["PHP_SELF"];?>" method="post"> > <input type="hidden" name="MAX_FILE_SIZE" value="16777215"> > > Send this file: <input name="user_file" type="file"> > Explanations : <TEXTAREA NAME="descript" ROWS=10 COLS=45 WRAP><?php > echo($descr); > ?></TEXTAREA> > <P><input type="submit" value="Send File" > name="submit"> > </form> > > </body> > </html>

« previous php.general (#173449) next »