try this article: http://www.radinks.com/upload/config.php It's a quick guide on configuring php for large file uploads.
all the best
ahmetax wrote:
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>
-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php