Jump to content

php file upload size limit problem??


naveenbj

Recommended Posts

Hello,

 

This is the code which i used for file uploading but from this code im only able to upload small files but for the large files(around 1.5Mb to 6 MB) ,im not able to upload .

 

here is the

?>
<? if(($action=="ad_c")
{
	$header_id=trim($_POST['file_header']);

	$file_name=trim($_FILES[file_name][name]);
	$current_time = time();
	$file_name=$current_time."#".$file_name;
	$destination_path=$CFG->dirroot.$CONNECTOR."files".$CONNECTOR.$file_name;
	move_uploaded_file($_FILES[file_name][tmp_name],$destination_path);

	$query="insert into file(header_id,file_name_server) values($header_id,'$file_name')";
	$result=$db->query($query);
	dbError($result);
	$error_flag=1;
	$error_message="File Added !!";
	$action="vi";

}
?>

---------------

so if anyone can modify this code for me is highly appriciated..

if you have any question for this thn plz ask me ..

Regards

Nj

Link to comment
https://forums.phpfreaks.com/topic/89521-php-file-upload-size-limit-problem/
Share on other sites

There are an awful lot of thing syou need to check and change. You should have a hidden field with a max file size set, which may need to be changed. You may also need to change various PHP settings in your php.ini file - including the max_file_size and max_execution_time.

like GingerRobot said have you checked your php.ini the default max file size is 2MB and max execution time is 30 seconds if you upload takes longer than 30 seconds it wont work or if the file is bigger than 2 MB check max_file_size and max_execution_time in your php.ini

 

Scott.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.