title: How Can I Upload Audio(mp3,ogg,flac) By Using PHP?
body: <p>i'm stuck in here</p>
  
  <p>I do this be before,and by using this PHP code to upload image,but when i try to change it to uploading audio file,it just can't upload it?</p>
  
  <p>My PHP code:(Upload Image[Work]):</p>
  
  <pre><code>&lt;?php
  $allowed = array('png', 'jpg', 'jpeg', 'gif', 'swf');
  if(isset($_FILES['upl']) &amp;&amp; $_FILES['upl']['error'] == 0){
  $extension = pathinfo($_FILES['upl']['name'], PATHINFO_EXTENSION);
  if(!in_array(strtolower($extension), $allowed)){
      echo '{"status":"error"}';
      exit;
  }
  if(move_uploaded_file($_FILES['upl']['tmp_name'], 'arts/'.$_FILES['upl']['name'])){
      echo '{"status":"success"}';
      exit;
  }
  }
  echo '{"status":"error"}';
  exit;
  }
  </code></pre>
  
  <p>PHP Code:(Upload Audio[Not Work]):</p>
  
  <pre><code>&lt;?php
  $allowed = array('mp3', 'ogg', 'flac');
  if(isset($_FILES['upl']) &amp;&amp; $_FILES['upl']['error'] == 0){
  $extension = pathinfo($_FILES['upl']['name'], PATHINFO_EXTENSION);
  if(!in_array(strtolower($extension), $allowed)){
  echo '{"status":"error"}';
  exit;
  }
  if(move_uploaded_file($_FILES['upl']['tmp_name'], 'upload/'.$_FILES['upl']['name'])){
  echo '{"status":"success"}';
  exit;
  }
  }
  echo '{"status":"error"}';
  exit;
  }
  ?&gt;
  </code></pre>