View Full Version : File uploading error

07-04-2007, 03:48 PM
I have this code:

if ($_FILES) {
echo '<pre>';
echo '</pre>';
<form style="margin: 0px;" method="post" action="file_upload_test.php" enctype="multipart/form-data">
<div style="margin: 4px;">
<input type="file" name="Picture1" value="" style="padding: 4px; width: 320px;">
<div style="margin: 4px;">
<input type="submit" value="Upload!" style="padding: 4px;">

I send form, and i have this messages:

[Picture1] => Array
[name] => 003.jpg
[type] =>
[tmp_name] =>
[error] => 1
[size] => 0


size always as 0, why?

thanks ... (and sorry for my english..)

07-04-2007, 03:55 PM
Because the [error] is 1 -

Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini. The file is bigger than the PHP settings allow. You need to increase the upload_max_filesize setting in php.ini or a .htaccess file.

07-04-2007, 03:57 PM
But my file is 1.33 kb

and upload_max_filesize value is 74

But i don't know, 74 is MB or KB or byte .. I don't know ..

How can I fix this error?

07-04-2007, 04:15 PM
The value is in bytes. So, 74 means 74bytes.

upload_max_filesize integer
The maximum size of an uploaded file.

When an integer is used, the value is measured in bytes. You may also use shorthand notation as described in this FAQ.And the FAQ -

The available options are K (for Kilobytes), M (for Megabytes) and G (for Gigabytes; available since PHP 5.1.0), these are case insensitive. Anything else assumes bytes. 1M equals one Megabyte or 1048576 bytes. 1K equals one Kilobyte or 1024 bytes. You may not use these shorthand notations outside of php.ini, instead use an integer value of bytes.

07-05-2007, 12:12 PM
i am having trouble with uploading, when i upload big size file like >2M
it hang the browser and show blank screen and file does not get upload.

upload_max_filesize is set 8M

also added set_time_limit(0); in my script

But same thing on local network works file, seems problem in more setting.

please help