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
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.