php - Photo upload not uploading files bigger than 2MB -


i have php file upload in place in forms target iframe.

it uploads files less 2mb fine. larger not upload. cant see reason behind in code.

<div id="upload_wrapper">  <img src="../images/logo.png" alt="logo5" width="" height="" style="padding:0px;" /> <h3>profile picture upload</h3>    <form id="upload" name="upload" enctype="multipart/form-data" method="post" action="index.php" target="upload_target">     <input name="folder" type="hidden" value="<?php echo $folder ?>"  />     <input name="filename" type="hidden" value="<?php echo $filename ?>"  />     <input name="uploaded_file" type="file" size="5120" id="uploaded_file"  />     <input id="sent" name="sent" type="submit"  value="upload" />   </form> </div> <div id="loading" style="background:url(ajax-loader.gif) no-repeat left; height:50px; width:370px; display:none;">   <p style="margin-left:40px; padding-top:15px;">uploading file... please wait</p> </div> <div id="image_wrapper" style="display:none;"><p id="preview"></p></div> <iframe id="upload_target" name="upload_target" style="width:10px; height:10px; display:none"></iframe> </div> 

and heres php upload code

if ($_server['request_method'] == 'post') {  $targetfolder = $_post['folder'] . "/"; $filename2 = $_post['filename'];  if (!is_dir($targetfolder))  {     mkdir($targetfolder, 0777); }      $tempfile = $_files['uploaded_file']['tmp_name'];     $targetpath = dirname(__file__) . '/' . $targetfolder;     $targetfile = rtrim($targetpath,'/') . '/' . $_files['uploaded_file']['name'];      // validate file type     $filetypes = array('jpg'); // file extensions     $fileparts = pathinfo($_files['uploaded_file']['name']);      if (in_array($fileparts['extension'],$filetypes))      {         $uploadfile = $targetfolder. basename($filename2 .".".$fileparts['extension']);          move_uploaded_file($tempfile,$uploadfile);          $filename = $uploadfile;     }      echo "<div id='filename'>$filename</div>";  } 

maybe changing php server's configuration (example 10mb):

ini_set('upload_max_filesize', '10m'); 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -