title: getting 413 Request Entity Too Large error from ajax when posting base64 image to folder by file_put_contents
body: <p>I m getting 413 Request Entity Too Large error while I sending my data by ajax
  I m getting converted base64 image encoded code...i m passing that to 
  My controller function in codeigniter.....
  that giving me error 413 Request Entity Too Large</p>
  
  <h2>my ajax code is bellow</h2>
  
  <pre><code>    $('#save-image-php').click(function() {
  
          $.ajax({
                      type: "POST",              
                      url: php_directory_save,       
                      data: { base64_image: yourDesigner.getProductDataURL()},
  
                      success: function(data) {
  
                           if(parseInt(data) &gt; 0) {
                              $( "#cart_pd" ).submit();
  
                              }
  
                      },
                      error: function() {
                          //alert('some error has occured...');
                      },
                      start: function() {
                          //alert('ajax has been started...');    
                      }
                  });
  
  
  });
  </code></pre>
  
  <h2>my codeigniter controller function</h2>
  
  <pre><code>    public function saveimage(){
  
  
          $base64_str = substr($this-&gt;input-&gt;post('base64_image'),strpos($this-&gt;input-&gt;post('base64_image'), ",")+1);
  
          $decoded = '';
          $decoded = base64_decode($base64_str);
  
          $png_name = '';
          $png_name = "product-".strtotime('now').".png";
  
          $png_url = '';
          $png_url = "uploaded_files/custom_image/".$png_name;
  
  
           $id = $this-&gt;product_model-&gt;save($png_name);
           $data = array('cust_id'=&gt;$id); 
           $this-&gt;session-&gt;set_userdata($data);
           $result  = '';
           $result = file_put_contents($png_url, $decoded);
  
          if($id !=''){
  
              header('Content-Type: application/json');
              echo json_encode($id);
  
                     }
  
      }   
  </code></pre>