Estoy creando una web con conexión a base de datos en godaddy. Al tratar de subir archivos relativamente grandes (4MB o más) a una carpeta al servidor me dice el explorador que la conexión ha sido reiniciada ¿a qué se debbe? pd: soy turboprincipiante
<?php ob_start();
include('conection.php');
$a = rand(1,100);
$b = rand(1,100);
$c = rand(1,100);
if(isset($_SESSION['user_name']))
{
$user = $_SESSION['user_name'];
$user_id = $_SESSION['id'];
$total = "file".$user.$a.$b.$c;
$file_name = isset($_FILES['file']['name']);
if(isset($_FILES['file']['tmp_name'])) $path = $_FILES['file']['tmp_name'];
else $path = null;
if(is_uploaded_file($path))
{
if($_FILES['file']['type'] == 'image/png' OR $_FILES['file']['type'] == 'image/gif' OR $_FILES['file']['type'] == 'image/jpeg' )
{
$extension = 'jpg';
$type = array('image/jpeg' => 'jpg');
$name = $user_id. $total.'.'.$extension;
$destination = "images/".$name;
copy($path, $destination);
$path_image = $destination;
$max_x = 600;
$max_y = 800;
$size = getimagesize($path_image);
$image_x = $size[0];
$image_y = $size[1];
$image_type = $size['mime'];
switch ( $image_type )
{
case "image/jpg":
case "image/jpeg":
$image = imagecreatefromjpeg( $path_image );
break;
case "image/png":
$image = imagecreatefrompng( $path_image );
break;
case "image/gif":
$image = imagecreatefromgif( $path_image );
break;
}//End switch
$panel = imagecreatetruecolor( $max_x, $max_y );
imagecopyresampled($panel, $image, 0, 0, 0, 0, $max_x, $max_y, $image_x, $image_y);
imagejpeg($panel, $destination, 80);
}//en if($_FILES['foto1']['type'] ==...
elseif($_FILES['file']['type']= "aplication/pdf")
{
$extension = 'pdf';
$name = $id. $total.'.'.$extension;
$destination = "files/".$name;
copy($path, $destination);
$path_image = $destination;
}
else {$destination = null;}
}//End if(is_uploaded_file(
ob_end_flush() ?>
<meta charset="UTF-8"/>
<div id="posting">
<form class="transparent-box" action="<?php ob_start(); echo $_SERVER['PHP_SELF']; ob_end_flush() ?>" method="post" enctype="multipart/form-data">
<textarea class="input-field" name="text" id="textarea" type="text" maxlenght = "140" rows="2" columns="70" placeholder=""/></textarea>
<input type="file" id="filebutton" name="file" class="input-button"/>
<select name="category" class="input-button">
<option value="0">Sin categoria</option>
<option value="1">Opción 1</option>
<option value="2">Opción 2</option>
<option value="3">Opción 3</option>
</select>
<input type="submit" name="send" class="input-button" value="Publicar " />
</form>
</div>
<?php ob_start();
if(isset($_POST['send']))
{
if(empty($_POST['text']))
{
echo "<script>alert('Campo de texto vacío.')</script>";
}//end if(empty
else
{
$con = new mysqli("localhost", "universalistas", "u12345", "universalistas");
$text = $_POST['text'];
$option = $_POST['category'];
$reg = mysqli_query($con, "INSERT INTO file (file, user_no_file, user_id_file, description_file, category_file) VALUES
('".$destination."', '".$user."', '".$user_id."', '".$text."', '".$option."')") or die(mysqli_error($con));
if($reg)
{
ob_end_flush() ?>
<?php ob_start();
header("Location: index.php?r=true");
ob_end_flush()?>
<?php ob_start();
}//End if($reg...
else echo "Error.";
}//end else
}//end if(isset($_POST['guardar']))
}//end if(isset(ses...
else echo "No estas logueado";
ob_end_flush() ?>
introducir el código aquí