Jump to content

script can't upload the large files


abubaker0000

Recommended Posts

<!doctype html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<title>Untitled Document</title>
</head>

<body>
<form action="upload_image.php" method="post" enctype="multipart/form-data">
<label>select page<input type="file" name="image">
<input type="submit" name="upload">
</label>
</form>
<?php 
if(isset($_POST['upload']))
{
	$image_name=$_FILES['image']['name']; //return the name ot image
	$image_type=$_FILES['image']['type']; //return the value of image
	$image_size=$_FILES['image']['size']; //return the size of image
	$image_tmp_name=$_FILES['image']['tmp_name'];//return the value
	if($image_name=='')
	{
		echo '<script type="text/javascript">alert("please select image")</script>';
		exit();
	}
	else
	{
		$ex=move_uploaded_file($image_tmp_name,"image/".$image_name);
		if($ex)
		{
		    echo 'image upload done "<br>"';
			echo $image_name.'<br>';
			echo $image_size.'<br>';
			echo $image_type.'<br>';
			echo $image_tmp_name.'<br>';
		}
		else
		{
			echo 'error';
		}
	}
}
?>
</body>
</html>

I make this simple script for upload files like photo , It's work correctly ,but not upload the large files ex 8MB images 12MB images

Link to comment
https://forums.phpfreaks.com/topic/291434-script-cant-upload-the-large-files/
Share on other sites

There are many configuration settings which determines the maximum file size that can be uploaded.

 

upload_max_filesize is one of them. There is also post_max_size, max_execution_time and max_input_time. This page explains the common pitfalls you may experience when uploading files.

 

Unless you have access to the php.ini you may not be able to override these settings. You may be able to use ini_set or Apache .htaccess php_flag directives to override those settings. If your host does not allow this then will not be able to upload files larger than the limit your host current allows.

 

NOTE: I have modified your topic title.

When modifying the php.ini you may need to restart your http server in order for the new settings to take affect. You should also run phpinfo() to confirm PHP is reading the php.ini you are editting and to confirm the changes you made in the php.ini has taken affect too.

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.