title: Changing name of the uploaded file in CodeIgniter (dots & underscores)
body: <p>I got some problems with changing name of uploaded file:</p>
  
  <pre><code>$config = array(
          'allowed_types' =&gt; 'mp3',
          'file_name' =&gt; $fulltitle,       // Lets say we've entered 'a.s.d.f.mp3'
          'upload_path' =&gt; './music/'
      );
  $this-&gt;load-&gt;library('upload', $config);        
  $this-&gt;upload-&gt;do_upload(); 
  </code></pre>
  
  <p>But, when I check my filename it shows me </p>
  
  <blockquote>
    <p>a.s_.d_.f_.mp3</p>
  </blockquote>
  
  <p>Why CodeIgniter add underscore before every dot after first one? How I can disable this?
  Thank you.</p>
  
  <p><strong>ADDED</strong></p>
  
  <p>Well I found solution. system->libraries->Upload.php file.</p>
  
  <p>Line 994, _prep_filename() function.</p>
  
  <pre><code>        $parts      = explode('.', $filename);
      $ext        = array_pop($parts);
      $filename   = array_shift($parts);
  
      foreach ($parts as $part)
      {
          if ( ! in_array(strtolower($part), $this-&gt;allowed_types) OR $this-&gt;mimes_types(strtolower($part)) === FALSE)
          {
              $filename .= '.'.$part.'_'; // Line 994
          }
          else
          {
              $filename .= '.'.$part;
          }
      }
  </code></pre>