File upload bug
| From: | Daniel Crespo | Date: | Wed, 24 Mar 2004 19:19:15 +0000 |
| Subject: | File upload bug | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-33627@lists.php.net to get a copy of this message | ||
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.