0

Hi
I am doing a simple php file upload script. Works fine but I cant upload more than 3MB files using this script... Please help me. This is my code

$target_path = "../items/";
$target_path = $target_path . basename( $_FILES['file1']['name']); 
$name=$_FILES['file1']['name'];
$ext=end(explode('.',$name));
if ($ext=="flv"){
move_uploaded_file($_FILES['file1']['tmp_name'], $target_path);
$new_name=$itemId.".".$ext;
rename ("../items/".$name, "../items/".$new_name); 

mysql_query("UPDATE video SET video='$new_name' WHERE id='$itemId'");
}

Thanks in advance
Rajeesh

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by lordspace
0

Works fine but I cant upload more than 3MB files using this script

refer to the following:
http://us2.php.net/manual/en/features.file-upload.post-method.php

specifically,

...The MAX_FILE_SIZE hidden field (measured in bytes) must precede the file input field, and its value is the maximum filesize accepted by PHP...

alternatively, if you have access to your php.ini file look for:
; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

and try increasing it.

Edited by hielo: n/a

0

I think the upload_max_filesize should be increased in the php.ini or in the .htaccess file. It would be too late to apply the limit in the php because the upload has already been processed or discarded...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.