title: MP3 files reduce in size and get corrupted after uploading from a form
body: <p>Here's the original mp3 file: <a href="http://eqreverb.com/sound_manager/songs/Pon-3jay%20LongR.mp3" rel="nofollow">Pon-3jay LongR.mp3</a><br>
  And here's the corrupted version: <a href="http://eqreverb.com/form/uploads/songs/djdavid98/pon-3jay%20longr.mp3" rel="nofollow">pon-3jay longr.mp3</a></p>
  
  <p>This is the script that moves the files over:</p>
  
  <pre><code>&lt;?php
  
  require_once "File.php";
  $path = "uploads/songs/";
  $valid_formats = array("mp3");
  $File = new File();
  
  $path = $path."djdavid98/";
  
      if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST"){
          $name = $_FILES['song']['name'];
          $size = $_FILES['song']['size'];
          $tmp  = $_FILES['song']['tmp_name'];
  
          if (!is_dir($path)) mkdir($path, 0777, true);
  
          if($File-&gt;upload($tmp, $actual_song_name,$path)){
              echo response($path.$actual_song_name,$actual_song_name,$txt.".".$ext);
          }
          else echo errText("Upload failed!", $path );
      }
  
  function errText($str,$fileName){
      return '{"song":{"sucess":"0","message":"' .$str. '","fileName":"' . $fileName . '"}}';
  }
  function response($filePath,$actualFileName,$fileName){
      return '{"song":{"sucess":"1","path":"' . $filePath . '","fileName":"' . $fileName . '"}}';
  }
  
  ?&gt;
  </code></pre>
  
  <p>File.php:</p>
  
  <pre><code>&lt;?php
      class File {
          public function upload($file, $filename, $target_path) {
              if (empty($filename)) { break; }
              try {
                  $target_path = $target_path . $filename;
  
                  if(move_uploaded_file($file, $target_path)) {
                      return true;
                  } else{
                      return false;
                  }
              } catch (Exception $ex) {
                  echo "Error on &lt;strong&gt;Line " . $ex-&gt;getLine() . " &lt;/strong&gt;: " . $ex-&gt;getMessage();
              }
          }
      }
  ?&gt;
  </code></pre>
  
  <p>Form:</p>
  
  <pre><code>&lt;form class="upload_form" enctype="multipart/form-data" style="height:0;opacity:0;"&gt;
      &lt;div class="grid-100 grid-parent"&gt;
          &lt;div class="grid-20"&gt;
              ...
              &lt;div data-input&gt;
                  &lt;span&gt;Song&lt;/span&gt;
                  &lt;div class="grid-100 grid-parent fileSelect"&gt;
                      &lt;div class="grid-60"&gt;
                          &lt;input type="text" disabled class="file-holder"&gt;
                      &lt;/div&gt;
                      &lt;div class="file-wrapper grid-40"&gt;
                          &lt;input type="file" name="song" required&gt;
                          &lt;div class="button styleWarning"&gt;Browse&lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="grid-80 grid-parent"&gt;
              ...
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This script is run on a CloudFlare host, just in case that changes anything. From what I noticed, all of the uploaded mp3 files upload as the same exact file. I honestly have no idea why this happens and how I could fix this. Any help is appreciated.</p>