title: access folder outside CodeIgniter
body: <p>I've been to trying to upload images using code igniter and it works perfectly when the upload folder is just outside of application folder. But my problem is when I try to access folder which is outside whole code igniter folder it is throwing me a error. How to access the folder outside the code igniter folder? I tried $_SERVER['DOCUMENT_ROOT']. But it dint help. </p>
  
  <pre><code>$name = $_POST['name'];
          $id = $_POST['id'];
          if (isset($_FILES['upload']['name'])) {
              // total files //
              $count = count($_FILES['upload']['name']);
              // all uploads //
              $uploads = $_FILES['upload'];
  
              for ($i = 0; $i &lt; $count; $i++) {
                  if ($uploads['error'][$i] == 0) {
                      $firstimage = $uploads['name'][$i];
                      $secondimage = $uploads['name'][$i];
  
                      move_uploaded_file($uploads['tmp_name'][$i], $_SERVER['DOCUMENT_ROOT'].'tuition/tuitionimage/'.$id.'/'.$uploads['name'][$i]);
                      $config2['image_library'] = 'gd2';
                      $config2['source_image'] = $_SERVER['DOCUMENT_ROOT'].'tuition/tuitionimage/'.$id.'/'.$uploads['name'][$i];
                      $config2['new_image'] = $_SERVER['DOCUMENT_ROOT'].'tuition/tuitionimage/'.$id.'/thumbnail/'.$uploads['name'][$i];
                      $config2['maintain_ratio'] = FALSE;
                      $config2['create_thumb'] = TRUE;
                      $config2['thumb_marker'] = '_thumb';
                      $config2['width'] = 75;
                      $config2['height'] = 50;
                      $config2['overwrite'] = TRUE;
  
                      $this-&gt;image_lib-&gt;initialize($config2);
                      $this-&gt;load-&gt;library('image_lib',$config2);
                      if ( ! $this-&gt;image_lib-&gt;resize())
                      {
                          echo $this-&gt;image_lib-&gt;display_errors();
                      }
  
                      $config3['image_library'] = 'gd2';
                      $config3['source_image'] = $_SERVER['DOCUMENT_ROOT'].'tuition/tuitionimage/'.$id.'/'.$uploads['name'][$i];
                      $config3['new_image'] = $_SERVER['DOCUMENT_ROOT'].'tuition/tuitionimage/'.$id.'/resize/'.$uploads['name'][$i];
                      $config3['maintain_ratio'] = FALSE;
                      $config3['create_thumb'] = TRUE;
                      $config3['thumb_marker'] = '_thumb';
                      $config3['width'] = 470;
                      $config3['height'] = 470;
                      $config3['overwrite'] = TRUE;
  
                      $this-&gt;image_lib-&gt;initialize($config3);
                      $this-&gt;load-&gt;library('image_lib',$config3);
                      if ( ! $this-&gt;image_lib-&gt;resize())
                      {
                          echo $this-&gt;image_lib-&gt;display_errors();
                      }
  
                      }
  
  
              }
              $this-&gt;load-&gt;view('head');
              $data = array(
                  'name' =&gt; $name,
                  'id' =&gt; $id
              ); 
  </code></pre>